-import { Component, EventEmitter, Input, OnChanges, Output, ViewChild } from '@angular/core'
+import { AfterContentInit, AfterViewInit, Component, EventEmitter, Input, OnChanges, OnInit, Output, ViewChild } from '@angular/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { DropdownAction, DropdownButtonSize, DropdownDirection } from '@app/shared/buttons/action-dropdown.component'
import { AuthService, ConfirmService, Notifier, ServerService } from '@app/core'
templateUrl: './video-actions-dropdown.component.html',
styleUrls: [ './video-actions-dropdown.component.scss' ]
})
-export class VideoActionsDropdownComponent implements OnChanges {
+export class VideoActionsDropdownComponent implements AfterViewInit, OnChanges {
@ViewChild('playlistDropdown') playlistDropdown: NgbDropdown
@ViewChild('playlistAdd') playlistAdd: VideoAddToPlaylistComponent
return this.authService.getUser()
}
+ ngAfterViewInit () {
+ // We rely on mouseenter to lazy load actions
+ if (this.screenService.isInTouchScreen()) {
+ this.loadDropdownInformation()
+ }
+ }
+
ngOnChanges () {
this.buildActions()
}
@import '_mixins';
@import '_miniature';
+$more-button-width: 41px;
+$more-margin-right: 10px;
+
.video-miniature {
width: $video-miniature-width;
display: inline-flex;
display: flex;
.video-miniature-information {
- width: 200px;
+ width: $video-miniature-width - $more-button-width - $more-margin-right;
line-height: normal;
.video-miniature-name {
.video-actions {
margin-top: 3px;
- margin-right: 10px;
+ margin-right: $more-margin-right;
+ width: $more-button-width;
+ height: 30px;
/deep/ .dropdown-root:not(.show) {
opacity: 0;
top: -3px;
/deep/ .dropdown-root {
- display: block !important;
+ opacity: 1 !important;
}
}
}