From 63a4a1b10cad8c15fe1431bd6460faa8766470cb Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Mon, 2 Dec 2013 07:15:14 +0000 Subject: [PATCH] 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 --- src/wp-admin/js/theme.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index e73715c1fc..4e7841d5c1 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -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;