Now using dynamic percentual appmenu limit

Signed-off-by: Patrik Kernstock <info@pkern.at>
This commit is contained in:
Patrik Kernstock 2017-06-04 03:26:40 +02:00 committed by Julius Härtl
parent d44786e9b7
commit 6acabd64ca
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 6 additions and 1 deletions

View 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;