Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions core/js/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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')) {
Expand Down
4 changes: 4 additions & 0 deletions core/js/tests/specs/coreSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,10 @@ describe('Core base tests', function() {
});
it('Clicking menu toggle toggles navigation in', function() {
window.initCore();
// fore show more apps icon since otherwise it would be hidden since no icons are available
clock.tick(1 * 1000);
$('#more-apps').show();

expect($navigation.is(':visible')).toEqual(false);
$toggle.click();
clock.tick(1 * 1000);
Expand Down