diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-03-24 10:27:00 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-03-24 11:29:28 +0100 |
commit | c3c251713151273562debee405763bb8f99947c8 (patch) | |
tree | 68b05ed5ffde4d9fd7c066a875c30c56bb57520b /settings/js | |
parent | 9cb07f126d027ddc0610fe0fcfd43016bc960ddb (diff) | |
download | nextcloud-server-c3c251713151273562debee405763bb8f99947c8.tar.gz nextcloud-server-c3c251713151273562debee405763bb8f99947c8.zip |
Display a message when no apps can be found for this oc version
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/apps.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js index bb52aa3a155..8d8b2ca7398 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -63,7 +63,9 @@ OC.Settings.Apps = OC.Settings.Apps || { } $('#apps-list') .addClass('icon-loading') + .removeClass('hidden') .html(''); + $('#apps-list-empty').addClass('hidden'); $('#app-category-' + OC.Settings.Apps.State.currentCategory).removeClass('active'); $('#app-category-' + categoryId).addClass('active'); OC.Settings.Apps.State.currentCategory = categoryId; @@ -73,14 +75,19 @@ OC.Settings.Apps = OC.Settings.Apps || { }), { data:{}, type:'GET', - success:function (apps) { + success: function (apps) { OC.Settings.Apps.State.apps = _.indexBy(apps.apps, 'id'); var source = $("#app-template").html(); var template = Handlebars.compile(source); - _.each(apps.apps, function(app) { - OC.Settings.Apps.renderApp(app, template, null); - }); + if (apps.apps.length) { + _.each(apps.apps, function(app) { + OC.Settings.Apps.renderApp(app, template, null); + }); + } else { + $('#apps-list').addClass('hidden'); + $('#apps-list-empty').removeClass('hidden'); + } }, complete: function() { $('#apps-list').removeClass('icon-loading'); |