aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-05-13 15:18:11 +0200
committerChocobozzz <me@florianbigard.com>2019-05-13 15:18:11 +0200
commit4da22f64e71166e7482cc2f04531c0c4a1f32e22 (patch)
tree630cfdc6f5725f74beba07c279a4d3335e74231f /client
parent9d1603d36be3ccdb84e77b19f727318fb95f2e0c (diff)
downloadPeerTube-4da22f64e71166e7482cc2f04531c0c4a1f32e22.tar.gz
PeerTube-4da22f64e71166e7482cc2f04531c0c4a1f32e22.tar.zst
PeerTube-4da22f64e71166e7482cc2f04531c0c4a1f32e22.zip
Lazy load dropdown info on click
Instead of mouseenter
Diffstat (limited to 'client')
-rw-r--r--client/src/app/shared/video/video-actions-dropdown.component.html2
-rw-r--r--client/src/app/shared/video/video-actions-dropdown.component.ts9
2 files changed, 2 insertions, 9 deletions
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.html b/client/src/app/shared/video/video-actions-dropdown.component.html
index 300fe318a..ec03fa55d 100644
--- a/client/src/app/shared/video/video-actions-dropdown.component.html
+++ b/client/src/app/shared/video/video-actions-dropdown.component.html
@@ -11,7 +11,7 @@
11 </div> 11 </div>
12 12
13 <my-action-dropdown 13 <my-action-dropdown
14 [actions]="videoActions" [label]="label" [entry]="{ video: video }" (mouseenter)="loadDropdownInformation()" 14 [actions]="videoActions" [label]="label" [entry]="{ video: video }" (click)="loadDropdownInformation()"
15 [buttonSize]="buttonSize" [placement]="placement" [buttonDirection]="buttonDirection" [buttonStyled]="buttonStyled" 15 [buttonSize]="buttonSize" [placement]="placement" [buttonDirection]="buttonDirection" [buttonStyled]="buttonStyled"
16 ></my-action-dropdown> 16 ></my-action-dropdown>
17 17
diff --git a/client/src/app/shared/video/video-actions-dropdown.component.ts b/client/src/app/shared/video/video-actions-dropdown.component.ts
index c1da0eba6..ee2f44f9e 100644
--- a/client/src/app/shared/video/video-actions-dropdown.component.ts
+++ b/client/src/app/shared/video/video-actions-dropdown.component.ts
@@ -28,7 +28,7 @@ export type VideoActionsDisplayType = {
28 templateUrl: './video-actions-dropdown.component.html', 28 templateUrl: './video-actions-dropdown.component.html',
29 styleUrls: [ './video-actions-dropdown.component.scss' ] 29 styleUrls: [ './video-actions-dropdown.component.scss' ]
30}) 30})
31export class VideoActionsDropdownComponent implements AfterViewInit, OnChanges { 31export class VideoActionsDropdownComponent implements OnChanges {
32 @ViewChild('playlistDropdown') playlistDropdown: NgbDropdown 32 @ViewChild('playlistDropdown') playlistDropdown: NgbDropdown
33 @ViewChild('playlistAdd') playlistAdd: VideoAddToPlaylistComponent 33 @ViewChild('playlistAdd') playlistAdd: VideoAddToPlaylistComponent
34 34
@@ -78,13 +78,6 @@ export class VideoActionsDropdownComponent implements AfterViewInit, OnChanges {
78 return this.authService.getUser() 78 return this.authService.getUser()
79 } 79 }
80 80
81 ngAfterViewInit () {
82 // We rely on mouseenter to lazy load actions
83 if (this.screenService.isInTouchScreen()) {
84 this.loadDropdownInformation()
85 }
86 }
87
88 ngOnChanges () { 81 ngOnChanges () {
89 this.buildActions() 82 this.buildActions()
90 } 83 }