Fix notification scrolling
This commit is contained in:
parent
624da0b0a4
commit
6e613df63f
|
@ -66,20 +66,20 @@ export class NotificationComponent implements OnInit, OnDestroy {
|
||||||
onPopoverShown () {
|
onPopoverShown () {
|
||||||
this.opened = true
|
this.opened = true
|
||||||
|
|
||||||
document.querySelector('menu').scrollTo(0, 0) // Reset menu scroll to easy lock
|
document.querySelector('nav').scrollTo(0, 0) // Reset menu scroll to easy lock
|
||||||
document.querySelector('menu').addEventListener('scroll', this.onMenuScrollEvent)
|
document.querySelector('nav').addEventListener('scroll', this.onMenuScrollEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
onPopoverHidden () {
|
onPopoverHidden () {
|
||||||
this.loaded = false
|
this.loaded = false
|
||||||
this.opened = false
|
this.opened = false
|
||||||
|
|
||||||
document.querySelector('menu').removeEventListener('scroll', this.onMenuScrollEvent)
|
document.querySelector('nav').removeEventListener('scroll', this.onMenuScrollEvent)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Lock menu scroll when menu scroll to avoid fleeing / detached dropdown
|
// Lock menu scroll when menu scroll to avoid fleeing / detached dropdown
|
||||||
onMenuScrollEvent () {
|
onMenuScrollEvent () {
|
||||||
document.querySelector('menu').scrollTo(0, 0)
|
document.querySelector('nav').scrollTo(0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
onNotificationLoaded () {
|
onNotificationLoaded () {
|
||||||
|
|
Loading…
Reference in New Issue