import { Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core'
import { NavigationEnd, Router } from '@angular/router'
import { MenuService, ScreenService } from '@app/core'
+import { scrollToTop } from '@app/helpers'
import { GlobalIconName } from '@app/shared/shared-icons'
import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap'
return this.screen.isInSmallView(marginLeft)
}
+ get isBroadcastMessageDisplayed () {
+ return this.screen.isBroadcastMessageDisplayed
+ }
+
ngOnInit () {
this.updateChildLabels(window.location.pathname)
.subscribe(() => this.updateChildLabels(window.location.pathname))
this.hasIcons = this.menuEntries.some(
- e => e.children && e.children.some(c => !!c.iconName)
+ e => e.children?.some(c => !!c.iconName)
)
}
this.modalService.open(this.modal, {
centered: true,
- beforeDismiss: async () => {
+ beforeDismiss: () => {
this.onModalDismiss()
+
return true
}
})
this.isModalOpened = false
}
+ onActiveLinkScrollToTop (link: HTMLAnchorElement) {
+ if (!this.isBroadcastMessageDisplayed && this.router.url.includes(link.getAttribute('href'))) {
+ scrollToTop('smooth')
+ }
+ }
+
dismissOtherModals () {
this.modalService.dismissAll()
}