From fa67ccd0a3272dfe5f561f79fef70498e4fe12ef Mon Sep 17 00:00:00 2001 From: Travis Chase Date: Tue, 1 Sep 2015 14:57:01 -0500 Subject: [PATCH] Adding a debounce --- src/assets/js/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/js/search.js b/src/assets/js/search.js index 28767996b..1c4d447f1 100644 --- a/src/assets/js/search.js +++ b/src/assets/js/search.js @@ -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)); },