diff options
author | Chocobozzz <me@florianbigard.com> | 2019-05-17 14:34:21 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-05-17 14:34:21 +0200 |
commit | 1c8ddbfaa03e241c782201343d424748efc191c1 (patch) | |
tree | 7e1f4b4108b3c500aa5e353e1f0ec903994d633c /client/src/app/videos | |
parent | 67c687236f84dd288f2df3201c8ab77b93682b67 (diff) | |
download | PeerTube-1c8ddbfaa03e241c782201343d424748efc191c1.tar.gz PeerTube-1c8ddbfaa03e241c782201343d424748efc191c1.tar.zst PeerTube-1c8ddbfaa03e241c782201343d424748efc191c1.zip |
Reset playlist add component when video changes
Diffstat (limited to 'client/src/app/videos')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index b147b75b0..631504eab 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -119,23 +119,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
119 | if (videoId) this.loadVideo(videoId) | 119 | if (videoId) this.loadVideo(videoId) |
120 | }) | 120 | }) |
121 | 121 | ||
122 | this.hotkeys = [ | 122 | this.initHotkeys() |
123 | new Hotkey('shift+l', (event: KeyboardEvent): boolean => { | ||
124 | this.setLike() | ||
125 | return false | ||
126 | }, undefined, this.i18n('Like the video')), | ||
127 | new Hotkey('shift+d', (event: KeyboardEvent): boolean => { | ||
128 | this.setDislike() | ||
129 | return false | ||
130 | }, undefined, this.i18n('Dislike the video')), | ||
131 | new Hotkey('shift+s', (event: KeyboardEvent): boolean => { | ||
132 | this.subscribeButton.subscribed ? | ||
133 | this.subscribeButton.unsubscribe() : | ||
134 | this.subscribeButton.subscribe() | ||
135 | return false | ||
136 | }, undefined, this.i18n('Subscribe to the account')) | ||
137 | ] | ||
138 | if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys) | ||
139 | } | 123 | } |
140 | 124 | ||
141 | ngOnDestroy () { | 125 | ngOnDestroy () { |
@@ -565,4 +549,24 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
565 | this.player = undefined | 549 | this.player = undefined |
566 | } | 550 | } |
567 | } | 551 | } |
552 | |||
553 | private initHotkeys () { | ||
554 | this.hotkeys = [ | ||
555 | new Hotkey('shift+l', (event: KeyboardEvent): boolean => { | ||
556 | this.setLike() | ||
557 | return false | ||
558 | }, undefined, this.i18n('Like the video')), | ||
559 | new Hotkey('shift+d', (event: KeyboardEvent): boolean => { | ||
560 | this.setDislike() | ||
561 | return false | ||
562 | }, undefined, this.i18n('Dislike the video')), | ||
563 | new Hotkey('shift+s', (event: KeyboardEvent): boolean => { | ||
564 | this.subscribeButton.subscribed ? | ||
565 | this.subscribeButton.unsubscribe() : | ||
566 | this.subscribeButton.subscribe() | ||
567 | return false | ||
568 | }, undefined, this.i18n('Subscribe to the account')) | ||
569 | ] | ||
570 | if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys) | ||
571 | } | ||
568 | } | 572 | } |