add a cache for the top menu update (#19)
This commit is contained in:
parent
bddd8e9c0c
commit
9a8f5517b6
|
@ -22,7 +22,6 @@
|
||||||
}
|
}
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
<?php if ($_['opener-only'] === true): ?>
|
<?php if ($_['opener-only'] === true): ?>
|
||||||
#nextcloud {
|
#nextcloud {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
@ -73,6 +73,8 @@
|
||||||
<?php if ($_['external-sites-in-top-menu']): ?>
|
<?php if ($_['external-sites-in-top-menu']): ?>
|
||||||
sideMenuContainer.attr('data-externalsitesintopmenu', '1')
|
sideMenuContainer.attr('data-externalsitesintopmenu', '1')
|
||||||
|
|
||||||
|
var menuCache = null
|
||||||
|
|
||||||
var updateTopMenu = function() {
|
var updateTopMenu = function() {
|
||||||
var breakpointMobileWidth = 1024
|
var breakpointMobileWidth = 1024
|
||||||
var menu = $('#appmenu')
|
var menu = $('#appmenu')
|
||||||
|
@ -87,6 +89,12 @@
|
||||||
var navigationApps = $('#apps ul')
|
var navigationApps = $('#apps ul')
|
||||||
var appCount = null
|
var appCount = null
|
||||||
|
|
||||||
|
var currentMenuCache = menu.html() + menu.next().html()
|
||||||
|
|
||||||
|
if (currentMenuCache === menuCache) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
navigationApps.html('')
|
navigationApps.html('')
|
||||||
|
|
||||||
apps.each(function(i, app) {
|
apps.each(function(i, app) {
|
||||||
|
@ -175,6 +183,8 @@
|
||||||
} else {
|
} else {
|
||||||
moreApps.show()
|
moreApps.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menuCache = menu.html() + menu.next().html()
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(updateTopMenu, 50)
|
setInterval(updateTopMenu, 50)
|
||||||
|
|
Loading…
Reference in New Issue