Skip to content
Snippets Groups Projects
Unverified Commit fe3374d8 authored by Julius Härtl's avatar Julius Härtl Committed by Roeland Jago Douma
Browse files

Add body class when dashboard is scrolled


Signed-off-by: default avatarJulius Härtl <jus@bitgrid.net>
parent d4502823
No related branches found
No related tags found
No related merge requests found
...@@ -235,6 +235,7 @@ export default { ...@@ -235,6 +235,7 @@ export default {
}, },
mounted() { mounted() {
this.updateGlobalStyles() this.updateGlobalStyles()
window.addEventListener('scroll', this.handleScroll)
setInterval(() => { setInterval(() => {
this.timer = new Date() this.timer = new Date()
...@@ -244,6 +245,9 @@ export default { ...@@ -244,6 +245,9 @@ export default {
window.addEventListener('scroll', this.disableFirstrunHint) window.addEventListener('scroll', this.disableFirstrunHint)
} }
}, },
destroyed() {
window.removeEventListener('scroll', this.handleScroll)
},
methods: { methods: {
/** /**
* Method to register panels that will be called by the integrating apps * Method to register panels that will be called by the integrating apps
...@@ -361,6 +365,13 @@ export default { ...@@ -361,6 +365,13 @@ export default {
} }
this.saveStatuses() this.saveStatuses()
}, },
handleScroll() {
if (window.scrollY > 50) {
document.body.classList.add('dashboard--scrolled')
} else {
document.body.classList.remove('dashboard--scrolled')
}
},
}, },
} }
</script> </script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment