hashchange
authorMike Shaver <shaver@mozilla.org>
Wed, 09 Feb 2011 04:32:11 +0000
changeset 39 6c2740178bcb
parent 38 0af4a5e5e4ab
child 40 b3ab76d708dc
push id30
push usershaver@mozilla.com
push dateWed, 09 Feb 2011 04:33:42 +0000
hashchange
server/static/search.js
--- a/server/static/search.js
+++ b/server/static/search.js
@@ -25,16 +25,21 @@ var results;
             div.append("<br>(Showing " + results.bugs.length + " of " + results.totalResults + " results)<br>");
         };
     xhr.sendTime = Date.now();
     xhr.send(null);
   };
 
   $("#submitton").bind("click", sendmsg);
 
+  $(window).bind("hashchange", function() {
+      $("#keywords").val(decodeURIComponent(location.hash.substring(1)));
+      sendmsg();      
+  });
+  
   $("#keywords").bind("keydown", function(e){
 
  if(e.keyCode == 32 || e.keyCode == 13 ||
    (e.keyCode == 8 && $("#keywords").val().substr(-2, 1) == " "))
 {
       sendmsg();
   }});