Browse Source

add a cache for the top menu update (#19)

pull/32/head
Simon Vieille 6 months ago
parent
commit
9a8f5517b6
Signed by: deblan GPG Key ID: 03383D15A1D31745
2 changed files with 10 additions and 1 deletions
  1. +0
    -1
      templates/css/stylesheet.php
  2. +10
    -0
      templates/js/script.php

+ 0
- 1
templates/css/stylesheet.php View File

@ -22,7 +22,6 @@
}
<?php endif; ?>
<?php if ($_['opener-only'] === true): ?>
#nextcloud {
display: none;

+ 10
- 0
templates/js/script.php View File

@ -73,6 +73,8 @@
<?php if ($_['external-sites-in-top-menu']): ?>
sideMenuContainer.attr('data-externalsitesintopmenu', '1')
var menuCache = null
var updateTopMenu = function() {
var breakpointMobileWidth = 1024
var menu = $('#appmenu')
@ -87,6 +89,12 @@
var navigationApps = $('#apps ul')
var appCount = null
var currentMenuCache = menu.html() + menu.next().html()
if (currentMenuCache === menuCache) {
return
}
navigationApps.html('')
apps.each(function(i, app) {
@ -175,6 +183,8 @@
} else {
moreApps.show()
}
menuCache = menu.html() + menu.next().html()
}
setInterval(updateTopMenu, 50)

Loading…
Cancel
Save