Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

Commit

Permalink
Moved search code into the template. No need for a separate file there.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevestreza committed Aug 7, 2013
1 parent f1361d2 commit a64820a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
9 changes: 0 additions & 9 deletions public/javascripts/search.js

This file was deleted.

1 change: 0 additions & 1 deletion views/index.hbs
Expand Up @@ -57,4 +57,3 @@
</div>
</div>
</div>
<script src="javascripts/search.js"></script>
11 changes: 11 additions & 0 deletions views/layout.hbs
Expand Up @@ -67,6 +67,17 @@
$(document).keyup(function(e){
$(document.body).removeClass("show-shortcuts");
});
var $rows = $("#services").children("div");
$('#search').keyup(function() {
var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
$rows.show().filter(function() {
var $this = $(this);
var text = $this.text().replace(/\s+/g, ' ').toLowerCase();
return !~text.indexOf(val);
}).hide();
});
});
</script>

Expand Down

0 comments on commit a64820a

Please sign in to comment.