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

Built from https://develop.svn.wordpress.org/trunk@26521


git-svn-id: http://core.svn.wordpress.org/trunk@26414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2013-12-02 07:16:10 +00:00
parent 6c9356b360
commit c054cdad32
2 changed files with 7 additions and 1 deletions

View File

@ -97,6 +97,12 @@ themes.Collection = Backbone.Collection.extend({
// and triggers an update event // and triggers an update event
doSearch: function( value ) { 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 // Updates terms with the value passed
this.terms = value; this.terms = value;

File diff suppressed because one or more lines are too long