Themes: Bail if the search term matches the currently rendered themes, Fixes the events being clobbered. Props jblz. Fixes #26347

git-svn-id: https://develop.svn.wordpress.org/trunk@26521 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2013-12-02 07:15:14 +00:00
parent 91b903fb6d
commit 63a4a1b10c
1 changed files with 6 additions and 0 deletions

View File

@ -97,6 +97,12 @@ themes.Collection = Backbone.Collection.extend({
// and triggers an update event
doSearch: function( value ) {
// Don't do anything if we've already done this search
// Useful because the Search handler fires multiple times per keystroke
if ( this.terms === value ) {
return;
}
// Updates terms with the value passed
this.terms = value;