Created
March 21, 2015 18:05
-
-
Save mmarum-sugarcrm/ec2abc261c935ac5e278 to your computer and use it in GitHub Desktop.
Use of _.debounce() in Sugar 7.5 filter-quicksearch.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
... | |
/** | |
* Fire quick search | |
* @param {Event} e | |
*/ | |
throttledSearch: _.debounce(function(e) { | |
var newSearch = this.$el.val(); | |
if(this.currentSearch !== newSearch) { | |
this.currentSearch = newSearch; | |
this.layout.trigger('filter:apply', newSearch); | |
} | |
}, 400), | |
... | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment