]> git.ipfire.org Git - thirdparty/Font-Awesome.git/commitdiff
Adding a debounce
authorTravis Chase <travis@travischase.me>
Tue, 1 Sep 2015 19:57:01 +0000 (14:57 -0500)
committerTravis Chase <travis@travischase.me>
Tue, 1 Sep 2015 19:57:01 +0000 (14:57 -0500)
src/assets/js/search.js

index 28767996b128b6694b456a99996ba2d5cdcf1390..1c4d447f120b57f1566321f0de72a146046be488 100644 (file)
@@ -1,7 +1,6 @@
 $(function() {
     var SearchView = Backbone.View.extend({
         events: {
-            "keyup #search-input": "search",
             "click #search-clear": "clear"
         },
 
@@ -15,6 +14,7 @@ $(function() {
             this.$searchInputClear = this.$("#search-clear");
             this.$iconsSection = this.$("#icons");
 
+            this.$searchInput.on("keyup", _.debounce(_.bind(this.search, this), 200));
             this.algoliaHelper.on("result", _.bind(this.showResults, this));
         },