Add edit button to scroll watch playlist on touchscreens
This commit is contained in:
parent
610d0be13b
commit
bedf0e6073
4 changed files with 94 additions and 5 deletions
|
@ -36,7 +36,9 @@
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div *ngIf="owned" class="more" ngbDropdown #moreDropdown="ngbDropdown" placement="bottom-right"
|
<my-edit-button *ngIf="owned && touchScreenEditButton" [routerLink]="[ '/my-account', 'video-playlists', playlist.uuid ]"></my-edit-button>
|
||||||
|
|
||||||
|
<div *ngIf="owned" class="more" ngbDropdown #moreDropdown="ngbDropdown" placement="bottom auto"
|
||||||
(openChange)="onDropdownOpenChange()" autoClose="outside"
|
(openChange)="onDropdownOpenChange()" autoClose="outside"
|
||||||
>
|
>
|
||||||
<my-global-icon iconName="more-vertical" ngbDropdownToggle role="button" class="icon-more" (click)="$event.preventDefault()"></my-global-icon>
|
<my-global-icon iconName="more-vertical" ngbDropdownToggle role="button" class="icon-more" (click)="$event.preventDefault()"></my-global-icon>
|
||||||
|
@ -82,8 +84,9 @@
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<span class="dropdown-item" (click)="removeFromPlaylist(playlistElement)">
|
<span class="dropdown-item" (click)="removeFromPlaylist(playlistElement)">
|
||||||
<my-global-icon iconName="delete"></my-global-icon> <ng-container i18n>Delete from {{ playlist?.displayName }}</ng-container>
|
<my-global-icon iconName="delete"></my-global-icon>
|
||||||
</span>
|
<ng-container i18n>Delete from {{ playlist?.displayName }}</ng-container>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -88,12 +88,15 @@ my-video-thumbnail,
|
||||||
@include ellipsis;
|
@include ellipsis;
|
||||||
}
|
}
|
||||||
|
|
||||||
.more {
|
.more, my-edit-button {
|
||||||
justify-self: flex-end;
|
justify-self: flex-end;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
opacity: 0;
|
|
||||||
min-width: 24px;
|
min-width: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.more {
|
||||||
|
opacity: 0;
|
||||||
|
|
||||||
&.show {
|
&.show {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
|
@ -132,3 +135,84 @@ my-video-thumbnail,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin more-dropdown-control {
|
||||||
|
.video {
|
||||||
|
my-edit-button {
|
||||||
|
display: none;
|
||||||
|
|
||||||
|
+ .more {
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin edit-button-control {
|
||||||
|
.video {
|
||||||
|
my-edit-button {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.playing {
|
||||||
|
my-edit-button {
|
||||||
|
display: inline-flex;
|
||||||
|
height: max-content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
my-edit-button + .more {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin edit-button-in-mobile-view {
|
||||||
|
.video {
|
||||||
|
my-edit-button {
|
||||||
|
::ng-deep .action-button-edit {
|
||||||
|
padding: 0 13px;
|
||||||
|
|
||||||
|
.button-label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: $small-view) {
|
||||||
|
:host-context(.expanded) {
|
||||||
|
@include more-dropdown-control();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: $small-view) {
|
||||||
|
:host-context(.expanded) {
|
||||||
|
@include edit-button-control();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: $mobile-view) {
|
||||||
|
:host-context(.expanded) {
|
||||||
|
@include edit-button-in-mobile-view();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-width: #{$small-view + $menu-width}) {
|
||||||
|
:host-context(.main-col:not(.expanded)) {
|
||||||
|
@include more-dropdown-control();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: #{$small-view + $menu-width}) {
|
||||||
|
:host-context(.main-col:not(.expanded)) {
|
||||||
|
@include edit-button-control();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: #{$mobile-view + $menu-width}) {
|
||||||
|
:host-context(.main-col:not(.expanded)) {
|
||||||
|
@include edit-button-in-mobile-view();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@ export class VideoPlaylistElementMiniatureComponent implements OnInit {
|
||||||
@Input() rowLink = false
|
@Input() rowLink = false
|
||||||
@Input() accountLink = true
|
@Input() accountLink = true
|
||||||
@Input() position: number // Keep this property because we're in the OnPush change detection strategy
|
@Input() position: number // Keep this property because we're in the OnPush change detection strategy
|
||||||
|
@Input() touchScreenEditButton = false
|
||||||
|
|
||||||
@Output() elementRemoved = new EventEmitter<VideoPlaylistElement>()
|
@Output() elementRemoved = new EventEmitter<VideoPlaylistElement>()
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
<my-video-playlist-element-miniature
|
<my-video-playlist-element-miniature
|
||||||
[playlistElement]="playlistElement" [playlist]="playlist" [owned]="isPlaylistOwned()" (elementRemoved)="onElementRemoved($event)"
|
[playlistElement]="playlistElement" [playlist]="playlist" [owned]="isPlaylistOwned()" (elementRemoved)="onElementRemoved($event)"
|
||||||
[playing]="currentPlaylistPosition === playlistElement.position" [accountLink]="false" [position]="playlistElement.position"
|
[playing]="currentPlaylistPosition === playlistElement.position" [accountLink]="false" [position]="playlistElement.position"
|
||||||
|
[touchScreenEditButton]="true"
|
||||||
></my-video-playlist-element-miniature>
|
></my-video-playlist-element-miniature>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue