aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rw-r--r--client/src/app/app.component.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index 7cd0fff1b..dc4d0bf6a 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -4,9 +4,10 @@ import { GuardsCheckStart, NavigationEnd, Router } from '@angular/router'
4import { AuthService, RedirectService, ServerService, ThemeService } from '@app/core' 4import { AuthService, RedirectService, ServerService, ThemeService } from '@app/core'
5import { is18nPath } from '../../../shared/models/i18n' 5import { is18nPath } from '../../../shared/models/i18n'
6import { ScreenService } from '@app/shared/misc/screen.service' 6import { ScreenService } from '@app/shared/misc/screen.service'
7import { skip } from 'rxjs/operators' 7import { skip, debounceTime } from 'rxjs/operators'
8import { HotkeysService, Hotkey } from 'angular2-hotkeys' 8import { HotkeysService, Hotkey } from 'angular2-hotkeys'
9import { I18n } from '@ngx-translate/i18n-polyfill' 9import { I18n } from '@ngx-translate/i18n-polyfill'
10import { fromEvent } from 'rxjs'
10 11
11@Component({ 12@Component({
12 selector: 'my-app', 13 selector: 'my-app',
@@ -28,6 +29,7 @@ export class AppComponent implements OnInit {
28 } 29 }
29 30
30 isMenuDisplayed = true 31 isMenuDisplayed = true
32 isMenuChangedByUser = false
31 33
32 customCSS: SafeHtml 34 customCSS: SafeHtml
33 35
@@ -165,6 +167,10 @@ export class AppComponent implements OnInit {
165 return false 167 return false
166 }, undefined, this.i18n('Toggle Dark theme')) 168 }, undefined, this.i18n('Toggle Dark theme'))
167 ]) 169 ])
170
171 fromEvent(window, 'resize')
172 .pipe(debounceTime(200))
173 .subscribe(() => this.onResize())
168 } 174 }
169 175
170 isUserLoggedIn () { 176 isUserLoggedIn () {
@@ -173,5 +179,10 @@ export class AppComponent implements OnInit {
173 179
174 toggleMenu () { 180 toggleMenu () {
175 this.isMenuDisplayed = !this.isMenuDisplayed 181 this.isMenuDisplayed = !this.isMenuDisplayed
182 this.isMenuChangedByUser = true
183 }
184
185 onResize () {
186 this.isMenuDisplayed = window.innerWidth >= 800 && !this.isMenuChangedByUser
176 } 187 }
177} 188}