From d768f84838db5bfd63801bac537fb901fec54cb7 Mon Sep 17 00:00:00 2001 From: Mario Romano Date: Thu, 1 Dec 2016 01:45:36 -0800 Subject: [PATCH] fix header options for mobile (#1186) * #1178 show header bar on mobile and tablet * #1178 add all options to burger icon on the right --- demo-shell-ng2/app/app.component.css | 10 ++ demo-shell-ng2/app/app.component.html | 134 ++++++++++++-------------- demo-shell-ng2/app/app.component.ts | 3 + demo-shell-ng2/index.html | 6 ++ 4 files changed, 82 insertions(+), 71 deletions(-) diff --git a/demo-shell-ng2/app/app.component.css b/demo-shell-ng2/app/app.component.css index 841bfef875..5ff84bf111 100644 --- a/demo-shell-ng2/app/app.component.css +++ b/demo-shell-ng2/app/app.component.css @@ -4,6 +4,12 @@ } } +@media screen and (max-width: 1024px) { + .mdl-layout__header { + display: block; + } +} + .mdl-layout-title { font-size: 17px; } @@ -15,3 +21,7 @@ .mdl-button-padding { padding-left: 20px; } + +.hide { + display: none !important; +} diff --git a/demo-shell-ng2/app/app.component.html b/demo-shell-ng2/app/app.component.html index 2986ba16ac..eaee64e9fd 100644 --- a/demo-shell-ng2/app/app.component.html +++ b/demo-shell-ng2/app/app.component.html @@ -1,82 +1,74 @@
-
-
-
+
+
+ + - + + Demo Application + +
+ + - - Demo Application - -
- - - - - - - - - - - -
-
- +
+ +
diff --git a/demo-shell-ng2/app/app.component.ts b/demo-shell-ng2/app/app.component.ts index 7a1835387b..8b3dec0f9b 100644 --- a/demo-shell-ng2/app/app.component.ts +++ b/demo-shell-ng2/app/app.component.ts @@ -74,10 +74,12 @@ export class AppComponent { .subscribe( () => { this.router.navigate(['/login']); + this.hideDrawer(); }, ($event: any) => { if ($event && $event.response && $event.response.status === 401) { this.router.navigate(['/login']); + this.hideDrawer(); } else { console.error('An unknown error occurred while logging out', $event); } @@ -97,6 +99,7 @@ export class AppComponent { changeLanguage(lang: string) { this.translate.use(lang); + this.hideDrawer(); } hideDrawer() { diff --git a/demo-shell-ng2/index.html b/demo-shell-ng2/index.html index 2fe2040a7f..aef1ee50c4 100644 --- a/demo-shell-ng2/index.html +++ b/demo-shell-ng2/index.html @@ -58,6 +58,12 @@ +