mirror of
https://github.com/akveo/ngx-admin.git
synced 2025-12-22 10:20:14 +01:00
fix(content top): #618, update tslint config
This commit is contained in:
parent
c70d866016
commit
e315b1a4df
2 changed files with 32 additions and 32 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
import { Component, ViewEncapsulation, Input, Output, EventEmitter } from '@angular/core';
|
import { Component, ViewEncapsulation, Input, Output, EventEmitter } from '@angular/core';
|
||||||
import {Router, Routes, NavigationEnd} from '@angular/router';
|
import { Router, NavigationEnd } from '@angular/router';
|
||||||
import { Subscription } from 'rxjs/Rx';
|
import { Subscription } from 'rxjs/Rx';
|
||||||
|
|
||||||
import { BaMenuService } from '../../services';
|
import { BaMenuService } from '../../services';
|
||||||
|
|
@ -27,19 +27,6 @@ export class BaMenu {
|
||||||
public outOfArea: number = -200;
|
public outOfArea: number = -200;
|
||||||
|
|
||||||
constructor(private _router: Router, private _service: BaMenuService, private _state: GlobalState) {
|
constructor(private _router: Router, private _service: BaMenuService, private _state: GlobalState) {
|
||||||
this._onRouteChange = this._router.events.subscribe((event) => {
|
|
||||||
|
|
||||||
if (event instanceof NavigationEnd) {
|
|
||||||
if (this.menuItems) {
|
|
||||||
this.selectMenuAndNotify();
|
|
||||||
} else {
|
|
||||||
// on page load we have to wait as event is fired before menu elements are prepared
|
|
||||||
setTimeout(() => this.selectMenuAndNotify());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this._menuItemsSub = this._service.menuItems.subscribe(this.updateMenu.bind(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateMenu(newMenuItems) {
|
public updateMenu(newMenuItems) {
|
||||||
|
|
@ -55,6 +42,19 @@ export class BaMenu {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnInit(): void {
|
public ngOnInit(): void {
|
||||||
|
this._onRouteChange = this._router.events.subscribe((event) => {
|
||||||
|
|
||||||
|
if (event instanceof NavigationEnd) {
|
||||||
|
if (this.menuItems) {
|
||||||
|
this.selectMenuAndNotify();
|
||||||
|
} else {
|
||||||
|
// on page load we have to wait as event is fired before menu elements are prepared
|
||||||
|
setTimeout(() => this.selectMenuAndNotify());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this._menuItemsSub = this._service.menuItems.subscribe(this.updateMenu.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ngOnDestroy(): void {
|
public ngOnDestroy(): void {
|
||||||
|
|
@ -70,7 +70,7 @@ export class BaMenu {
|
||||||
}
|
}
|
||||||
|
|
||||||
public toggleSubMenu($event): boolean {
|
public toggleSubMenu($event): boolean {
|
||||||
var submenu = jQuery($event.currentTarget).next();
|
let submenu = jQuery($event.currentTarget).next();
|
||||||
|
|
||||||
if (this.sidebarCollapsed) {
|
if (this.sidebarCollapsed) {
|
||||||
this.expandMenu.emit(null);
|
this.expandMenu.emit(null);
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
],
|
],
|
||||||
"max-line-length": [
|
"max-line-length": [
|
||||||
true,
|
true,
|
||||||
100
|
120
|
||||||
],
|
],
|
||||||
"no-require-imports": false,
|
"no-require-imports": false,
|
||||||
"no-trailing-whitespace": true,
|
"no-trailing-whitespace": true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue