Compare commits

..

2 Commits

Author SHA1 Message Date
Simon Vieille 8368562ed0 release v1.6.2 2020-05-14 13:28:39 +02:00
Simon Vieille 9a8f5517b6 add a cache for the top menu update (#19) 2020-05-13 12:25:11 +02:00
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ You can report a bug or request a feature by opening an issue.
]]></description> ]]></description>
<licence>agpl</licence> <licence>agpl</licence>
<author mail="contact@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author> <author mail="contact@deblan.fr" homepage="https://www.deblan.io/">Simon Vieille</author>
<version>1.6.1</version> <version>1.6.2</version>
<namespace>SideMenu</namespace> <namespace>SideMenu</namespace>
<category>customization</category> <category>customization</category>
<website>https://gitnet.fr/deblan/side_menu</website> <website>https://gitnet.fr/deblan/side_menu</website>
-1
View File
@@ -22,7 +22,6 @@
} }
<?php endif; ?> <?php endif; ?>
<?php if ($_['opener-only'] === true): ?> <?php if ($_['opener-only'] === true): ?>
#nextcloud { #nextcloud {
display: none; display: none;
+10
View File
@@ -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)