diff --git a/_assets/speedy.coffee b/_assets/speedy.coffee index 58bf6ec..b68305e 100644 --- a/_assets/speedy.coffee +++ b/_assets/speedy.coffee @@ -25,8 +25,7 @@ setRelatedDOMVisibility = (keyword) -> $('.js-queue-all').toggle (!!keyword.length && foundSomething) $('.no-result').toggle( !foundSomething ) -$(document).on 'search keyup', '.speedy-filter', -> - search( $(this).val() ) +$(document).on 'search keyup', '.speedy-filter', -> location.hash = $(this).val() $(document).on 'click', '.group', -> @@ -35,9 +34,9 @@ $(document).on 'click', '.group', -> $(document).on 'click', '.speedy-remover', -> $('.speedy-filter').val('') $('.result').show() - search (location.hash = '') + location.hash = '' window.onhashchange = -> search $('.speedy-filter').val(location.hash.substr(1)).val() $('[href^="#"]').removeClass('active') - $("[href='#{location.hash}']").addClass('active') \ No newline at end of file + $("[href='#{location.hash}']").addClass('active') diff --git a/javascripts/speedy.js b/javascripts/speedy.js index c0c1f35..3c5cb4a 100644 --- a/javascripts/speedy.js +++ b/javascripts/speedy.js @@ -39,7 +39,6 @@ setRelatedDOMVisibility = function(keyword) { }; $(document).on('search keyup', '.speedy-filter', function() { - search($(this).val()); return location.hash = $(this).val(); }); @@ -50,7 +49,7 @@ $(document).on('click', '.group', function() { $(document).on('click', '.speedy-remover', function() { $('.speedy-filter').val(''); $('.result').show(); - return search((location.hash = '')); + return location.hash = ''; }); window.onhashchange = function() {