Commits

Sam Toyer committed 880e73f

Work on gametype tag toggling a bit

  • Participants
  • Parent commits 36123a8

Comments (0)

Files changed (1)

File static/xonmap.js

     return score;
 }
 
-function remove_gametype_tag(tag) {
-}
-
-function add_gametype_tag(tag) {
-    var e = $("#q");
-    var v = e.val();
-}
-
 function toggle_gametype_filter() {
-    /*var name = $(this).text();
-    var q = new Query($("#q").val());
-    if (q.gametype*/
-    alert("I haven't implemented that yet! Arrrrgh!");
+    var name = $(this).text();
+    var qe = $("#q");
+    var q = new Query(qe.val());
+    if (q.gametypes.indexOf(name) == -1) {
+        // add the gametype to search
+        qe.val(q.query.replace(/\s*$/, ' ' + name));
+    }
+    else {
+        // remove the gametype from search
+        // TODO: implement
+    }
 }
 
 function on_search() {