Dismiss modals on pop state
This commit is contained in:
parent
f9e387ed05
commit
4334445d04
|
@ -8,9 +8,10 @@ import { debounceTime, filter, map, pairwise, skip } from 'rxjs/operators'
|
||||||
import { Hotkey, HotkeysService } from 'angular2-hotkeys'
|
import { Hotkey, HotkeysService } from 'angular2-hotkeys'
|
||||||
import { I18n } from '@ngx-translate/i18n-polyfill'
|
import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||||
import { fromEvent } from 'rxjs'
|
import { fromEvent } from 'rxjs'
|
||||||
import { ViewportScroller } from '@angular/common'
|
import { PlatformLocation, ViewportScroller } from '@angular/common'
|
||||||
import { PluginService } from '@app/core/plugins/plugin.service'
|
import { PluginService } from '@app/core/plugins/plugin.service'
|
||||||
import { HooksService } from '@app/core/plugins/hooks.service'
|
import { HooksService } from '@app/core/plugins/hooks.service'
|
||||||
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'my-app',
|
selector: 'my-app',
|
||||||
|
@ -35,7 +36,9 @@ export class AppComponent implements OnInit {
|
||||||
private screenService: ScreenService,
|
private screenService: ScreenService,
|
||||||
private hotkeysService: HotkeysService,
|
private hotkeysService: HotkeysService,
|
||||||
private themeService: ThemeService,
|
private themeService: ThemeService,
|
||||||
private hooks: HooksService
|
private hooks: HooksService,
|
||||||
|
private location: PlatformLocation,
|
||||||
|
private modalService: NgbModal
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
get serverVersion () {
|
get serverVersion () {
|
||||||
|
@ -90,6 +93,8 @@ export class AppComponent implements OnInit {
|
||||||
fromEvent(window, 'resize')
|
fromEvent(window, 'resize')
|
||||||
.pipe(debounceTime(200))
|
.pipe(debounceTime(200))
|
||||||
.subscribe(() => this.onResize())
|
.subscribe(() => this.onResize())
|
||||||
|
|
||||||
|
this.location.onPopState(() => this.modalService.dismissAll())
|
||||||
}
|
}
|
||||||
|
|
||||||
isUserLoggedIn () {
|
isUserLoggedIn () {
|
||||||
|
|
Loading…
Reference in New Issue