mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-20 18:13:18 +03:00
Added context menu on right click of the unified file cards, with options to open a file in the player or do so in a new tab
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
||||
import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { VideoInfoDialogComponent } from 'app/dialogs/video-info-dialog/video-info-dialog.component';
|
||||
import { DomSanitizer } from '@angular/platform-browser';
|
||||
import { MatMenuTrigger } from '@angular/material/menu';
|
||||
|
||||
@Component({
|
||||
selector: 'app-unified-file-card',
|
||||
@@ -33,6 +34,9 @@ export class UnifiedFileCardComponent implements OnInit {
|
||||
@Output() deleteFile = new EventEmitter<any>();
|
||||
@Output() editPlaylist = new EventEmitter<any>();
|
||||
|
||||
@ViewChild(MatMenuTrigger) contextMenu: MatMenuTrigger;
|
||||
contextMenuPosition = { x: '0px', y: '0px' };
|
||||
|
||||
/*
|
||||
Planned sizes:
|
||||
small: 150x175
|
||||
@@ -87,6 +91,15 @@ export class UnifiedFileCardComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
onRightClick(event) {
|
||||
event.preventDefault();
|
||||
this.contextMenuPosition.x = event.clientX + 'px';
|
||||
this.contextMenuPosition.y = event.clientY + 'px';
|
||||
this.contextMenu.menuData = { 'item': {id: 1, name: 'hi'} };
|
||||
this.contextMenu.menu.focusFirstItem('mouse');
|
||||
this.contextMenu.openMenu();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function fancyTimeFormat(time) {
|
||||
|
||||
Reference in New Issue
Block a user