Compare commits

..

4 Commits

3 changed files with 12 additions and 6 deletions
+4
View File
@@ -1,5 +1,9 @@
## [Unreleased] ## [Unreleased]
## 5.0.1
### Fixed
* fix(StandardMenu): appLimit must return a value > 0
## 5.0.0 ## 5.0.0
### Fixed ### Fixed
* fix apps's order in the standard menu * fix apps's order in the standard menu
+1 -1
View File
@@ -30,7 +30,7 @@ Notice
Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**. Because I believe in a free and decentralized Internet, [Gitnet](https://gitnet.fr) is **self-hosted at home**.
In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/). In case of downtime, you can download **Custom Menu** from [here](https://kim.deblan.fr/~side_menu/).
]]></description> ]]></description>
<version>5.0.0</version> <version>5.0.1</version>
<licence>agpl</licence> <licence>agpl</licence>
<author mail="contact@deblan.fr" homepage="https://www.deblan.fr/">Simon Vieille</author> <author mail="contact@deblan.fr" homepage="https://www.deblan.fr/">Simon Vieille</author>
<namespace>SideMenu</namespace> <namespace>SideMenu</namespace>
+7 -5
View File
@@ -142,7 +142,7 @@ const appLimit = () => {
}) })
} }
return Math.floor((body.offsetWidth - size) / 70) return Math.max(0, Math.floor((body.offsetWidth - size) / 70))
} }
const makeStyle = (app) => { const makeStyle = (app) => {
@@ -158,6 +158,11 @@ const computeLists = () => {
popoverAppList.value = appList.value.slice(appLimit()).sort((a, b) => a.order - b.order) popoverAppList.value = appList.value.slice(appLimit()).sort((a, b) => a.order - b.order)
} }
const reComputeLists = (delay) => {
window.clearTimeout(resizeTimeout)
resizeTimeout = window.setTimeout(computeLists, delay || 100)
}
onMounted(async () => { onMounted(async () => {
const config = await configStore.getConfig() const config = await configStore.getConfig()
@@ -169,10 +174,7 @@ onMounted(async () => {
setApps(await navStore.getCoreApps()) setApps(await navStore.getCoreApps())
window.addEventListener('resize', () => { window.addEventListener('resize', reComputeLists)
window.clearTimeout(resizeTimeout)
resizeTimeout = window.setTimeout(computeLists, 100)
})
}) })
</script> </script>