]> source.dussan.org Git - nextcloud-server.git/commitdiff
Now using dynamic percentual appmenu limit
authorPatrik Kernstock <info@pkern.at>
Sun, 4 Jun 2017 01:26:40 +0000 (03:26 +0200)
committerJulius Härtl <jus@bitgrid.net>
Thu, 15 Jun 2017 08:55:04 +0000 (10:55 +0200)
Signed-off-by: Patrik Kernstock <info@pkern.at>
core/js/js.js

index ee4b03dd99d7799976b8cee9f33435ad13fab60f..b878cd35b77ad97fa81213c2bf5965306cc12a6d 100644 (file)
@@ -1512,12 +1512,17 @@ function initCore() {
 
        var resizeMenu = function() {
                var appList = $('#appmenu li');
-               var availableWidth = $('#header-left').width() - $('#nextcloud').width() - 44;
+               var usePercentualAppMenuLimit = 33;
+               var availableWidth = (($('#header-left').width() - $('#nextcloud').width()) / 100 * usePercentualAppMenuLimit);
                var appCount = Math.floor((availableWidth)/44);
                // show at least 2 apps in the popover
                if(appList.length-1-appCount >= 1) {
                        appCount--;
                }
+               // show at least one icon
+               if(appCount < 1) {
+                       appCount = 1;
+               }
 
                $('#more-apps a').removeClass('active');
                var lastShownApp;