From 08969ece9e39e64a5f0e5f8a00e8bf70345afa41 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 29 Jun 2014 09:15:08 +0000 Subject: [PATCH] Show a "No themes found" message if the search for an installed theme doesn't produce any results. props gauravmittal1995 for initial patch. fixes #28587. git-svn-id: https://develop.svn.wordpress.org/trunk@28890 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/theme.js | 6 ++++++ src/wp-admin/themes.php | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index f06fb81b19..c13f917b57 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -190,6 +190,12 @@ themes.Collection = Backbone.Collection.extend({ return match.test( haystack ); }); + if ( results.length === 0 ) { + this.trigger( 'query:empty' ); + } else { + $( 'body' ).removeClass( 'no-results' ); + } + this.reset( results ); }, diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php index 0117c0dd81..ad5896cc56 100644 --- a/src/wp-admin/themes.php +++ b/src/wp-admin/themes.php @@ -233,6 +233,8 @@ foreach ( $themes as $theme ) :
+

+ true ) ) ) {