aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-06 11:07:30 +0100
committerChocobozzz <me@florianbigard.com>2019-12-06 11:07:30 +0100
commit3d216ea0f74cfa47312b97bae0e24885b563dd6d (patch)
tree9082c1a14f66039d5516f48521de02cdd2365dd0 /client/src/app/videos
parent941c5eac1751ef93500d6afa58c4575f777dbff9 (diff)
downloadPeerTube-3d216ea0f74cfa47312b97bae0e24885b563dd6d.tar.gz
PeerTube-3d216ea0f74cfa47312b97bae0e24885b563dd6d.tar.zst
PeerTube-3d216ea0f74cfa47312b97bae0e24885b563dd6d.zip
Fix dropdown on video miniature for unlogged users
Diffstat (limited to 'client/src/app/videos')
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts41
1 files changed, 23 insertions, 18 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 eee7adfd8..0de621aca 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -69,7 +69,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
69 likesBarTooltipText = '' 69 likesBarTooltipText = ''
70 hasAlreadyAcceptedPrivacyConcern = false 70 hasAlreadyAcceptedPrivacyConcern = false
71 remoteServerDown = false 71 remoteServerDown = false
72 hotkeys: Hotkey[] 72 hotkeys: Hotkey[] = []
73 73
74 private nextVideoUuid = '' 74 private nextVideoUuid = ''
75 private currentTime: number 75 private currentTime: number
@@ -147,7 +147,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
147 if (this.queryParamsSub) this.queryParamsSub.unsubscribe() 147 if (this.queryParamsSub) this.queryParamsSub.unsubscribe()
148 148
149 // Unbind hotkeys 149 // Unbind hotkeys
150 if (this.isUserLoggedIn()) this.hotkeysService.remove(this.hotkeys) 150 this.hotkeysService.remove(this.hotkeys)
151 } 151 }
152 152
153 setLike () { 153 setLike () {
@@ -650,21 +650,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
650 650
651 private initHotkeys () { 651 private initHotkeys () {
652 this.hotkeys = [ 652 this.hotkeys = [
653 new Hotkey('shift+l', () => {
654 this.setLike()
655 return false
656 }, undefined, this.i18n('Like the video')),
657
658 new Hotkey('shift+d', () => {
659 this.setDislike()
660 return false
661 }, undefined, this.i18n('Dislike the video')),
662
663 new Hotkey('shift+s', () => {
664 this.subscribeButton.subscribed ? this.subscribeButton.unsubscribe() : this.subscribeButton.subscribe()
665 return false
666 }, undefined, this.i18n('Subscribe to the account')),
667
668 // These hotkeys are managed by the player 653 // These hotkeys are managed by the player
669 new Hotkey('f', e => e, undefined, this.i18n('Enter/exit fullscreen (requires player focus)')), 654 new Hotkey('f', e => e, undefined, this.i18n('Enter/exit fullscreen (requires player focus)')),
670 new Hotkey('space', e => e, undefined, this.i18n('Play/Pause the video (requires player focus)')), 655 new Hotkey('space', e => e, undefined, this.i18n('Play/Pause the video (requires player focus)')),
@@ -683,6 +668,26 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
683 668
684 new Hotkey('.', e => e, undefined, this.i18n('Navigate in the video frame by frame (requires player focus)')) 669 new Hotkey('.', e => e, undefined, this.i18n('Navigate in the video frame by frame (requires player focus)'))
685 ] 670 ]
686 if (this.isUserLoggedIn()) this.hotkeysService.add(this.hotkeys) 671
672 if (this.isUserLoggedIn()) {
673 this.hotkeys = this.hotkeys.concat([
674 new Hotkey('shift+l', () => {
675 this.setLike()
676 return false
677 }, undefined, this.i18n('Like the video')),
678
679 new Hotkey('shift+d', () => {
680 this.setDislike()
681 return false
682 }, undefined, this.i18n('Dislike the video')),
683
684 new Hotkey('shift+s', () => {
685 this.subscribeButton.subscribed ? this.subscribeButton.unsubscribe() : this.subscribeButton.subscribe()
686 return false
687 }, undefined, this.i18n('Subscribe to the account'))
688 ])
689 }
690
691 this.hotkeysService.add(this.hotkeys)
687 } 692 }
688} 693}