Skip to content

Commit 0469af4

Browse files
authored
fix table media bug (#26)
* fix table media bug * version change
1 parent 3636127 commit 0469af4

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

src/app/theme/layout/admin/admin.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
</div>
2222
</div>
2323
</div>
24+
<div class="pc-menu-overlay" (click)="closeMenu()" (keydown)="handleKeyDown($event)" tabindex="0"></div>
2425
</div>
2526
<app-configuration></app-configuration>

src/app/theme/layout/admin/admin.component.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,16 @@ export class AdminComponent {
3636
this.navCollapsedMob = !this.navCollapsedMob;
3737
}
3838
}
39+
40+
handleKeyDown(event: KeyboardEvent): void {
41+
if (event.key === 'Escape') {
42+
this.closeMenu();
43+
}
44+
}
45+
46+
closeMenu() {
47+
if (document.querySelector('app-navigation.pcoded-navbar').classList.contains('mob-open')) {
48+
document.querySelector('app-navigation.pcoded-navbar')?.classList.remove('mob-open');
49+
}
50+
}
3951
}

src/app/theme/layout/admin/navigation/nav-content/nav-content.component.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// angular import
2-
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
2+
import { Component, EventEmitter, Output } from '@angular/core';
33
import { Location } from '@angular/common';
44

55
// project import
@@ -11,7 +11,7 @@ import { environment } from 'src/environments/environment';
1111
templateUrl: './nav-content.component.html',
1212
styleUrls: ['./nav-content.component.scss']
1313
})
14-
export class NavContentComponent implements OnInit {
14+
export class NavContentComponent {
1515
// public props
1616
title = 'Demo application for version numbering';
1717
currentApplicationVersion = environment.appVersion;
@@ -28,16 +28,6 @@ export class NavContentComponent implements OnInit {
2828
this.navigation = this.nav.get();
2929
}
3030

31-
// life cycle event
32-
ngOnInit() {
33-
if (this.windowWidth < 992) {
34-
setTimeout(() => {
35-
document.querySelector('.pcoded-navbar').classList.add('menupos-static');
36-
(document.querySelector('#nav-ps-datta') as HTMLElement).style.maxHeight = '100%';
37-
}, 500);
38-
}
39-
}
40-
4131
// public method
4232
navMob() {
4333
if (this.windowWidth < 992 && document.querySelector('app-navigation.pcoded-navbar').classList.contains('mob-open')) {

src/scss/menu/_menu-lite.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@
11251125
~ .pcoded-main-container {
11261126
margin-left: $Menu-collapsed-width;
11271127

1128-
&:before {
1128+
.pc-menu-overlay {
11291129
position: absolute;
11301130
top: 0;
11311131
left: 0;
@@ -1213,7 +1213,6 @@
12131213

12141214
.pcoded-navbar {
12151215
margin-left: -#{$Menu-width};
1216-
position: absolute;
12171216
height: 100%;
12181217
box-shadow: none;
12191218

0 commit comments

Comments
 (0)