aboutsummaryrefslogtreecommitdiffstats
path: root/core/src
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2022-08-30 22:05:50 +0200
committerJulius Härtl <jus@bitgrid.net>2022-08-31 10:24:04 +0200
commit09d8214e37183dc9347562d432e96761faf405f6 (patch)
tree0ee8f18241e658ae99e3da6bea1f9afab5b1bc8c /core/src
parente8193c243410262607f272fee5351632e5baa941 (diff)
downloadnextcloud-server-09d8214e37183dc9347562d432e96761faf405f6.tar.gz
nextcloud-server-09d8214e37183dc9347562d432e96761faf405f6.zip
Use resize observer
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'core/src')
-rw-r--r--core/src/components/AppMenu.vue7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/components/AppMenu.vue b/core/src/components/AppMenu.vue
index ca96fa569c6..1b2e45e2c0b 100644
--- a/core/src/components/AppMenu.vue
+++ b/core/src/components/AppMenu.vue
@@ -68,6 +68,7 @@ export default {
return {
apps: loadState('core', 'apps', {}),
appLimit: 0,
+ observer: null,
}
},
computed: {
@@ -87,9 +88,13 @@ export default {
},
},
mounted() {
- window.addEventListener('resize', this.resize)
+ this.observer = new ResizeObserver(this.resize)
+ this.observer.observe(this.$el)
this.resize()
},
+ beforeDestroy() {
+ this.observer.disconnect()
+ },
methods: {
setNavigationCounter(id, counter) {
this.$set(this.apps[id], 'unread', counter)