Lazy load dropdown info on click
authorChocobozzz <me@florianbigard.com>
Mon, 13 May 2019 13:18:11 +0000 (15:18 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 13 May 2019 13:18:11 +0000 (15:18 +0200)
Instead of mouseenter

client/src/app/shared/video/video-actions-dropdown.component.html
client/src/app/shared/video/video-actions-dropdown.component.ts

index 300fe318aa1f2debd4627785a469a873ddbd162e..ec03fa55d13eb77fbffae7353d3513b7a674c4d1 100644 (file)
@@ -11,7 +11,7 @@
   </div>
 
   <my-action-dropdown
-    [actions]="videoActions" [label]="label" [entry]="{ video: video }" (mouseenter)="loadDropdownInformation()"
+    [actions]="videoActions" [label]="label" [entry]="{ video: video }" (click)="loadDropdownInformation()"
     [buttonSize]="buttonSize" [placement]="placement" [buttonDirection]="buttonDirection" [buttonStyled]="buttonStyled"
   ></my-action-dropdown>
 
index c1da0eba6e37920459d71c7ca77f22585d70dee2..ee2f44f9e4f9e69ce8b8d6bfb85709f2a2088b65 100644 (file)
@@ -28,7 +28,7 @@ export type VideoActionsDisplayType = {
   templateUrl: './video-actions-dropdown.component.html',
   styleUrls: [ './video-actions-dropdown.component.scss' ]
 })
-export class VideoActionsDropdownComponent implements AfterViewInit, OnChanges {
+export class VideoActionsDropdownComponent implements OnChanges {
   @ViewChild('playlistDropdown') playlistDropdown: NgbDropdown
   @ViewChild('playlistAdd') playlistAdd: VideoAddToPlaylistComponent
 
@@ -78,13 +78,6 @@ export class VideoActionsDropdownComponent implements AfterViewInit, OnChanges {
     return this.authService.getUser()
   }
 
-  ngAfterViewInit () {
-    // We rely on mouseenter to lazy load actions
-    if (this.screenService.isInTouchScreen()) {
-      this.loadDropdownInformation()
-    }
-  }
-
   ngOnChanges () {
     this.buildActions()
   }