From 89ac71355df63bbad814d05999cc44d98d75fadf Mon Sep 17 00:00:00 2001 From: "Felix A. Epp" Date: Sat, 21 Jan 2017 17:10:08 +0100 Subject: Add apps category 'all installed' Signed-off-by: Felix A. Epp --- settings/js/apps.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'settings/js/apps.js') diff --git a/settings/js/apps.js b/settings/js/apps.js index 3d94a128d3f..bde069e1b27 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -41,7 +41,8 @@ OC.Settings.Apps = OC.Settings.Apps || { var categories = [ {displayName: t('settings', 'Enabled'), ident: 'enabled', id: '0'}, - {displayName: t('settings', 'Not enabled'), ident: 'disabled', id: '1'} + {displayName: t('settings', 'Not enabled'), ident: 'disabled', id: '1'}, + {displayName: t('settings', 'All installed'), ident: 'installed', id: '2'} ]; var source = $("#categories-template").html(); @@ -95,7 +96,7 @@ OC.Settings.Apps = OC.Settings.Apps || { return _.extend({level: 0}, app); }); var source - if (categoryId === 'enabled' || categoryId === 'disabled') { + if (categoryId === 'enabled' || categoryId === 'disabled' || categoryId === 'installed') { source = $("#app-template-installed").html(); $('#apps-list').addClass('installed'); } else { @@ -106,11 +107,15 @@ OC.Settings.Apps = OC.Settings.Apps || { if (appList.length) { appList.sort(function(a,b) { - var levelDiff = b.level - a.level; - if (levelDiff === 0) { - return OC.Util.naturalSortCompare(a.name, b.name); + if (a.active !== b.active) { + return (a.active ? -1 : 1) + } else { + var levelDiff = b.level - a.level; + if (levelDiff === 0) { + return OC.Util.naturalSortCompare(a.name, b.name); + } + return levelDiff; } - return levelDiff; }); var firstExperimental = false; -- cgit v1.2.3