diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-04-25 17:25:28 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2017-04-25 17:31:24 +0200 |
commit | 673b58ef093c252a2cf6da1ebf4027b050e306de (patch) | |
tree | 97ed9a0276102002f409ccee36dbf8e3cec02e90 /settings | |
parent | 7548825743bd2f7a65105b224c4eabe325c893b5 (diff) | |
download | nextcloud-server-673b58ef093c252a2cf6da1ebf4027b050e306de.tar.gz nextcloud-server-673b58ef093c252a2cf6da1ebf4027b050e306de.zip |
Fix adding/removing apps
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'settings')
-rw-r--r-- | settings/js/apps.js | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/settings/js/apps.js b/settings/js/apps.js index 6da8c395ecb..3326886951f 100644 --- a/settings/js/apps.js +++ b/settings/js/apps.js @@ -487,22 +487,22 @@ OC.Settings.Apps = OC.Settings.Apps || { container.children('li[data-id]').each(function (index, el) { var id = $(el).data('id'); // remove all apps that are not in the correct order - if ((navEntries[index] && navEntries[index].id !== $(el).data('id'))) { + if (!navEntries[index] || (navEntries[index] && navEntries[index].id !== $(el).data('id'))) { $(el).remove(); $('#appmenu li[data-id='+id+']').remove(); } }); - var previousEntry; + var previousEntry = {}; // add enabled apps to #navigation and #appmenu for (var i = 0; i < navEntries.length; i++) { var entry = navEntries[i]; if (container.children('li[data-id="' + entry.id + '"]').length === 0) { var li = $('<li></li>'); li.attr('data-id', entry.id); - var img = '<svg width="32" height="32" viewBox="0 0 32 32">'; + var img = '<svg width="16" height="16" viewBox="0 0 16 16">'; img += '<defs><filter id="invert"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0" /></filter></defs>'; - img += '<image x="0" y="0" width="32" height="32" preserveAspectRatio="xMinYMin meet" filter="url(#invert)" xlink:href="' + entry.icon + '" class="app-icon" /></svg>'; + img += '<image x="0" y="0" width="16" height="16" preserveAspectRatio="xMinYMin meet" filter="url(#invert)" xlink:href="' + entry.icon + '" class="app-icon" /></svg>'; var a = $('<a></a>').attr('href', entry.href); var filename = $('<span></span>'); var loading = $('<div class="icon-loading-dark"></div>').css('display', 'none'); @@ -526,9 +526,7 @@ OC.Settings.Apps = OC.Settings.Apps || { } } - if ($('#appmenu ul').children('li[data-id="' + entry.id + '"]').length === 0) { - // add apps to #appmenu until it is full - if ($('#appmenu li').not('.hidden').length < 8) { + if ($('#appmenu').children('li[data-id="' + entry.id + '"]').length === 0) { var li = $('<li></li>'); li.attr('data-id', entry.id); var img = '<img src="' + entry.icon + '" class="app-icon">'; @@ -547,22 +545,11 @@ OC.Settings.Apps = OC.Settings.Apps || { .animate({opacity: 0.5}) .animate({opacity: 1}); } - } } previousEntry = entry; - // do not show apps from #appmenu in #navigation - if(i <= 7) { - $('#navigation li').eq(i).addClass('in-header'); - } else { - $('#navigation li').eq(i).removeClass('in-header'); - } } - if (navEntries.length > 8) { - $('#more-apps').show(); - } else { - $('#more-apps').hide(); - } + $(window).trigger('resize'); } }); }, |