aboutsummaryrefslogtreecommitdiffstats
path: root/core/js/js.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/js.js')
-rw-r--r--core/js/js.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/js/js.js b/core/js/js.js
index fd6e0a68da5..026cc6bb0d6 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -1562,13 +1562,14 @@ function initCore() {
var resizeMenu = function() {
var appList = $('#appmenu li');
- var headerWidth = $('.header-left').outerWidth() - $('#nextcloud').outerWidth();
+ var rightHeaderWidth = $('.header-right').outerWidth();
+ var headerWidth = $('header').outerWidth();
var usePercentualAppMenuLimit = 0.33;
var minAppsDesktop = 8;
- var availableWidth = headerWidth - $(appList).width();
+ var availableWidth = headerWidth - $('#nextcloud').outerWidth() - (rightHeaderWidth > 210 ? rightHeaderWidth : 210)
var isMobile = $(window).width() < 768;
if (!isMobile) {
- availableWidth = headerWidth * usePercentualAppMenuLimit;
+ availableWidth = availableWidth * usePercentualAppMenuLimit;
}
var appCount = Math.floor((availableWidth / $(appList).width()));
if (isMobile && appCount > minAppsDesktop) {
@@ -1613,7 +1614,7 @@ function initCore() {
}
};
$(window).resize(resizeMenu);
- resizeMenu();
+ setTimeout(resizeMenu, 0);
// just add snapper for logged in users
if($('#app-navigation').length && !$('html').hasClass('lte9')) {