diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-10-15 17:00:00 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-10-26 16:15:14 +0100 |
commit | 145865ade0bb70ac0a24255428aea0b6dfe879e0 (patch) | |
tree | 63d7cb7c7097cb8e84eb69027a06d39b0822915a /settings | |
parent | 69e4a806b74cf58596c86e6094eaf2208a9e7051 (diff) | |
download | nextcloud-server-145865ade0bb70ac0a24255428aea0b6dfe879e0.tar.gz nextcloud-server-145865ade0bb70ac0a24255428aea0b6dfe879e0.zip |
Display empty-content when there are no search results
Diffstat (limited to 'settings')
-rw-r--r-- | settings/js/apps.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js index d4f70d1ab7a..fd2b5a3c918 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -414,9 +414,12 @@ OC.Settings.Apps = OC.Settings.Apps || { }, filter: function(query) { - var $appList = $('#apps-list'); + var $appList = $('#apps-list'), + $emptyList = $('#apps-list-empty'); if (query === '') { $appList.find('.section').removeClass('hidden'); + $appList.removeClass('hidden'); + $emptyList.addClass('hidden'); return; } query = query.toLowerCase(); @@ -456,11 +459,16 @@ OC.Settings.Apps = OC.Settings.Apps || { apps = _.uniq(apps, function(app){return app.id;}); - _.each(apps, function (app) { - $('#app-' + app.id).removeClass('hidden'); - }); + if (apps.length === 0) { + $appList.addClass('hidden'); + $emptyList.removeClass('hidden'); + } else { + _.each(apps, function (app) { + $('#app-' + app.id).removeClass('hidden'); + }); - $('#searchresults').hide(); + $('#searchresults').hide(); + } }, /** |