aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-26 10:47:07 +0200
committerChocobozzz <me@florianbigard.com>2019-05-13 09:45:37 +0200
commit743f023c5361af1428e927171effb2616d4e0245 (patch)
tree953146557a0c7bcbc0d1ab8ae9f672a101d1a17d /client
parenta18f275d302bbd95443c258b8d92f6dfd8eb1653 (diff)
downloadPeerTube-743f023c5361af1428e927171effb2616d4e0245.tar.gz
PeerTube-743f023c5361af1428e927171effb2616d4e0245.tar.zst
PeerTube-743f023c5361af1428e927171effb2616d4e0245.zip
Fix videos more dropdown position/loading
Diffstat (limited to 'client')
-rw-r--r--client/src/app/shared/video/video-actions-dropdown.component.ts11
-rw-r--r--client/src/app/shared/video/video-miniature.component.scss11
-rw-r--r--client/src/app/shared/video/video-miniature.component.ts2
3 files changed, 18 insertions, 6 deletions
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 787ef1188..b2d77a9e6 100644
--- a/client/src/app/shared/video/video-actions-dropdown.component.ts
+++ b/client/src/app/shared/video/video-actions-dropdown.component.ts
@@ -1,4 +1,4 @@
1import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core' 1import { AfterContentInit, AfterViewInit, Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core'
2import { I18n } from '@ngx-translate/i18n-polyfill' 2import { I18n } from '@ngx-translate/i18n-polyfill'
3import { DropdownAction, DropdownButtonSize, DropdownDirection } from '@app/shared/buttons/action-dropdown.component' 3import { DropdownAction, DropdownButtonSize, DropdownDirection } from '@app/shared/buttons/action-dropdown.component'
4import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core' 4import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core'
@@ -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 OnChanges { 31export class VideoActionsDropdownComponent implements AfterViewInit, OnChanges {
32 @ViewChild('playlistDropdown') playlistDropdown: NgbDropdown 32 @ViewChild('playlistDropdown') playlistDropdown: NgbDropdown
33 @ViewChild('playlistAdd') playlistAdd: VideoAddToPlaylistComponent 33 @ViewChild('playlistAdd') playlistAdd: VideoAddToPlaylistComponent
34 34
@@ -78,6 +78,13 @@ export class VideoActionsDropdownComponent implements 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
81 ngOnChanges () { 88 ngOnChanges () {
82 this.buildActions() 89 this.buildActions()
83 } 90 }
diff --git a/client/src/app/shared/video/video-miniature.component.scss b/client/src/app/shared/video/video-miniature.component.scss
index 6e173af99..d665ce021 100644
--- a/client/src/app/shared/video/video-miniature.component.scss
+++ b/client/src/app/shared/video/video-miniature.component.scss
@@ -2,6 +2,9 @@
2@import '_mixins'; 2@import '_mixins';
3@import '_miniature'; 3@import '_miniature';
4 4
5$more-button-width: 41px;
6$more-margin-right: 10px;
7
5.video-miniature { 8.video-miniature {
6 width: $video-miniature-width; 9 width: $video-miniature-width;
7 display: inline-flex; 10 display: inline-flex;
@@ -14,7 +17,7 @@
14 display: flex; 17 display: flex;
15 18
16 .video-miniature-information { 19 .video-miniature-information {
17 width: 200px; 20 width: $video-miniature-width - $more-button-width - $more-margin-right;
18 line-height: normal; 21 line-height: normal;
19 22
20 .video-miniature-name { 23 .video-miniature-name {
@@ -61,7 +64,9 @@
61 64
62 .video-actions { 65 .video-actions {
63 margin-top: 3px; 66 margin-top: 3px;
64 margin-right: 10px; 67 margin-right: $more-margin-right;
68 width: $more-button-width;
69 height: 30px;
65 70
66 /deep/ .dropdown-root:not(.show) { 71 /deep/ .dropdown-root:not(.show) {
67 opacity: 0; 72 opacity: 0;
@@ -86,7 +91,7 @@
86 top: -3px; 91 top: -3px;
87 92
88 /deep/ .dropdown-root { 93 /deep/ .dropdown-root {
89 display: block !important; 94 opacity: 1 !important;
90 } 95 }
91 } 96 }
92 } 97 }
diff --git a/client/src/app/shared/video/video-miniature.component.ts b/client/src/app/shared/video/video-miniature.component.ts
index e32b8cbc5..48475033c 100644
--- a/client/src/app/shared/video/video-miniature.component.ts
+++ b/client/src/app/shared/video/video-miniature.component.ts
@@ -74,7 +74,7 @@ export class VideoMiniatureComponent implements OnInit {
74 74
75 // We rely on mouseenter to lazy load actions 75 // We rely on mouseenter to lazy load actions
76 if (this.screenService.isInTouchScreen()) { 76 if (this.screenService.isInTouchScreen()) {
77 this.showActions = true 77 this.loadActions()
78 } 78 }
79 } 79 }
80 80