]> source.dussan.org Git - nextcloud-server.git/commitdiff
Decimal percentage, dynamic appIcon width
authorPatrik Kernstock <info@pkern.at>
Sat, 10 Jun 2017 15:33:01 +0000 (17:33 +0200)
committerJulius Härtl <jus@bitgrid.net>
Thu, 15 Jun 2017 08:55:11 +0000 (10:55 +0200)
Signed-off-by: Patrik Kernstock <info@pkern.at>
core/js/js.js

index b878cd35b77ad97fa81213c2bf5965306cc12a6d..80b36bad053a1e724760e51d882c6f3263959dcc 100644 (file)
@@ -1512,9 +1512,9 @@ function initCore() {
 
        var resizeMenu = function() {
                var appList = $('#appmenu li');
-               var usePercentualAppMenuLimit = 33;
-               var availableWidth = (($('#header-left').width() - $('#nextcloud').width()) / 100 * usePercentualAppMenuLimit);
-               var appCount = Math.floor((availableWidth)/44);
+               var usePercentualAppMenuLimit = 0.33;
+               var availableWidth = (($('#header-left').width() - $('#nextcloud').width()) * usePercentualAppMenuLimit);
+               var appCount = Math.floor((availableWidth / $(appList).width()));
                // show at least 2 apps in the popover
                if(appList.length-1-appCount >= 1) {
                        appCount--;