diff --git a/public/javascripts/search.js b/public/javascripts/search.js deleted file mode 100644 index a7ba5fc..0000000 --- a/public/javascripts/search.js +++ /dev/null @@ -1,9 +0,0 @@ -var $rows = $("#services").children("div"); -console.log($rows); -$('#search').keyup(function() { - var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase(); - $rows.show().filter(function() { - var text = $(this).text().replace(/\s+/g, ' ').toLowerCase(); - return !~text.indexOf(val); - }).hide(); -}); \ No newline at end of file diff --git a/views/index.hbs b/views/index.hbs index 436f084..4ba8478 100644 --- a/views/index.hbs +++ b/views/index.hbs @@ -57,4 +57,3 @@ - \ No newline at end of file diff --git a/views/layout.hbs b/views/layout.hbs index b13fa41..cef61cf 100644 --- a/views/layout.hbs +++ b/views/layout.hbs @@ -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(); + }); });