mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Now using dynamic percentual appmenu limit
Signed-off-by: Patrik Kernstock <info@pkern.at>
This commit is contained in:
parent
f03d6f225e
commit
c88e4e2feb
1 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue