-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathadmin.component.ts
More file actions
51 lines (45 loc) · 1.54 KB
/
Copy pathadmin.component.ts
File metadata and controls
51 lines (45 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// angular import
import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
// project import
import { NavBarComponent } from './nav-bar/nav-bar.component';
import { NavigationComponent } from './navigation/navigation.component';
import { ConfigurationComponent } from 'src/app/theme/layout/admin/configuration/configuration.component';
import { BreadcrumbsComponent } from '../../shared/components/breadcrumbs/breadcrumbs.component';
import { Footer } from './footer/footer';
@Component({
selector: 'app-admin',
imports: [NavBarComponent, NavigationComponent, RouterModule, CommonModule, ConfigurationComponent, BreadcrumbsComponent, Footer],
templateUrl: './admin.component.html',
styleUrls: ['./admin.component.scss']
})
export class AdminComponent {
// public props
navCollapsed;
navCollapsedMob: boolean;
windowWidth: number;
// constructor
constructor() {
this.windowWidth = window.innerWidth;
this.navCollapsedMob = false;
}
// public method
navMobClick() {
this.navCollapsedMob = !this.navCollapsedMob;
if (this.navCollapsedMob) {
document.querySelector('app-navigation.pcoded-navbar')?.classList.add('mob-open');
} else {
document.querySelector('app-navigation.pcoded-navbar')?.classList.remove('mob-open');
}
}
// this is for eslint rule
handleKeyDown(event: KeyboardEvent): void {
if (event.key === 'Escape') {
this.closeMenu();
}
}
closeMenu() {
this.navCollapsedMob = false;
}
}