aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/menu/menu.service.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-17 10:19:45 +0200
committerChocobozzz <me@florianbigard.com>2020-08-17 10:19:53 +0200
commit1bfc7b737975201645f43e58b485e864b3589bb3 (patch)
treec790b38f99783050b2f86926481e79b5693a497b /client/src/app/core/menu/menu.service.ts
parent245b9d27bc10a4d8c8eb64add06b653f12763f56 (diff)
downloadPeerTube-1bfc7b737975201645f43e58b485e864b3589bb3.tar.gz
PeerTube-1bfc7b737975201645f43e58b485e864b3589bb3.tar.zst
PeerTube-1bfc7b737975201645f43e58b485e864b3589bb3.zip
Some code style fixes
Diffstat (limited to 'client/src/app/core/menu/menu.service.ts')
-rw-r--r--client/src/app/core/menu/menu.service.ts19
1 files changed, 9 insertions, 10 deletions
diff --git a/client/src/app/core/menu/menu.service.ts b/client/src/app/core/menu/menu.service.ts
index 671ee3e4f..9c0433bca 100644
--- a/client/src/app/core/menu/menu.service.ts
+++ b/client/src/app/core/menu/menu.service.ts
@@ -28,15 +28,16 @@ export class MenuService {
28 setMenuDisplay (display: boolean) { 28 setMenuDisplay (display: boolean) {
29 this.isMenuDisplayed = display 29 this.isMenuDisplayed = display
30 30
31 if (!this.screenService.isInTouchScreen()) return
32
31 // On touch screens, lock body scroll and display content overlay when memu is opened 33 // On touch screens, lock body scroll and display content overlay when memu is opened
32 if (this.screenService.isInTouchScreen()) { 34 if (this.isMenuDisplayed) {
33 if (this.isMenuDisplayed) { 35 document.body.classList.add('menu-open')
34 document.body.classList.add('menu-open') 36 this.screenService.onFingerSwipe('left', () => { this.setMenuDisplay(false) })
35 this.screenService.onFingerSwipe('left', () => { this.setMenuDisplay(false) }) 37 return
36 } else {
37 document.body.classList.remove('menu-open')
38 }
39 } 38 }
39
40 document.body.classList.remove('menu-open')
40 } 41 }
41 42
42 onResize () { 43 onResize () {
@@ -45,9 +46,7 @@ export class MenuService {
45 46
46 private handleWindowResize () { 47 private handleWindowResize () {
47 // On touch screens, do not handle window resize event since opened menu is handled with a content overlay 48 // On touch screens, do not handle window resize event since opened menu is handled with a content overlay
48 if (this.screenService.isInTouchScreen()) { 49 if (this.screenService.isInTouchScreen()) return
49 return
50 }
51 50
52 fromEvent(window, 'resize') 51 fromEvent(window, 'resize')
53 .pipe(debounceTime(200)) 52 .pipe(debounceTime(200))