Browse Source
Merge pull request #11777 from abpframework/Issue-11617
navBar collapse added when route is changed
pull/11797/head
Muhammed Altuğ
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
11 additions and
4 deletions
-
npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts
-
npm/ng-packs/packages/theme-basic/src/lib/services/layout.service.ts
|
|
|
@ -1,8 +1,9 @@ |
|
|
|
import { eLayoutType, SubscriptionService } from '@abp/ng.core'; |
|
|
|
import {eLayoutType, SubscriptionService} from '@abp/ng.core'; |
|
|
|
import { collapseWithMargin, slideFromBottom } from '@abp/ng.theme.shared'; |
|
|
|
import { AfterViewInit, Component } from '@angular/core'; |
|
|
|
import {AfterViewInit, Component} from '@angular/core'; |
|
|
|
import { LayoutService } from '../../services/layout.service'; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
selector: 'abp-layout-application', |
|
|
|
templateUrl: './application-layout.component.html', |
|
|
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import { SubscriptionService } from '@abp/ng.core'; |
|
|
|
import {RouterEvents, SubscriptionService} from '@abp/ng.core'; |
|
|
|
import { ChangeDetectorRef, Injectable } from '@angular/core'; |
|
|
|
import { fromEvent } from 'rxjs'; |
|
|
|
import { debounceTime } from 'rxjs/operators'; |
|
|
|
@ -16,7 +16,13 @@ export class LayoutService { |
|
|
|
|
|
|
|
navItemsComponentKey = eThemeBasicComponents.NavItems; |
|
|
|
|
|
|
|
constructor(private subscription: SubscriptionService, private cdRef: ChangeDetectorRef) {} |
|
|
|
constructor(private subscription: SubscriptionService, |
|
|
|
private cdRef: ChangeDetectorRef, |
|
|
|
routerEvents:RouterEvents) { |
|
|
|
subscription.addOne(routerEvents.getNavigationEvents("End"),() => { |
|
|
|
this.isCollapsed = true; |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
private checkWindowWidth() { |
|
|
|
const isSmallScreen = window.innerWidth < 992; |
|
|
|
|