bugfix/standard-menu-mobile #411
2 changed files with 11 additions and 5 deletions
fix(StandardMenu): appLimit must return a value > 0
commit
7b4b447754
|
|
@ -1,5 +1,9 @@
|
|||
## [Unreleased]
|
||||
|
||||
## 5.0.1
|
||||
### Fixed
|
||||
* fix(StandardMenu): appLimit must return a value > 0
|
||||
|
||||
## 5.0.0
|
||||
### Fixed
|
||||
* fix apps's order in the standard menu
|
||||
|
|
|
|||
|
|
@ -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) => {
|
||||
|
|
@ -158,6 +158,11 @@ const computeLists = () => {
|
|||
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 () => {
|
||||
const config = await configStore.getConfig()
|
||||
|
||||
|
|
@ -169,10 +174,7 @@ onMounted(async () => {
|
|||
|
||||
setApps(await navStore.getCoreApps())
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
window.clearTimeout(resizeTimeout)
|
||||
resizeTimeout = window.setTimeout(computeLists, 100)
|
||||
})
|
||||
window.addEventListener('resize', reComputeLists)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue