mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
use shared play menu
This commit is contained in:
parent
f3cde16786
commit
83adc06fa2
15 changed files with 222 additions and 164 deletions
|
@ -1604,10 +1604,10 @@
|
|||
html += '</a>';
|
||||
|
||||
if (options.overlayPlayButton && !item.IsPlaceHolder && (item.LocationType != 'Virtual' || !item.MediaType || item.Type == 'Program') && item.Type != 'Person' && item.PlayAccess == 'Full') {
|
||||
html += '<div class="cardOverlayButtonContainer"><button is="paper-icon-button-light" class="cardOverlayPlayButton autoSize" onclick="return false;"><i class="md-icon">play_arrow</i></button></div>';
|
||||
html += '<div class="cardOverlayButtonContainer"><button is="paper-icon-button-light" class="cardOverlayPlayButton itemAction autoSize" data-action="playmenu" onclick="return false;"><i class="md-icon">play_arrow</i></button></div>';
|
||||
}
|
||||
if (options.overlayMoreButton) {
|
||||
html += '<div class="cardOverlayButtonContainer"><button is="paper-icon-button-light" class="cardOverlayMoreButton menuButton autoSize" onclick="return false;"><i class="md-icon">' + AppInfo.moreIcon.replace('-', '_') + '</i></button></div>';
|
||||
html += '<div class="cardOverlayButtonContainer"><button is="paper-icon-button-light" class="cardOverlayMoreButton itemAction autoSize" data-action="menu" onclick="return false;"><i class="md-icon">' + AppInfo.moreIcon.replace('-', '_') + '</i></button></div>';
|
||||
}
|
||||
|
||||
// cardScalable
|
||||
|
@ -1632,7 +1632,7 @@
|
|||
|
||||
if (options.cardLayout) {
|
||||
html += '<div class="cardButtonContainer">';
|
||||
html += '<button is="paper-icon-button-light" class="menuButton btnCardOptions autoSize"><i class="md-icon">' + AppInfo.moreIcon.replace('-', '_') + '</i></button>';
|
||||
html += '<button is="paper-icon-button-light" class="itemAction btnCardOptions autoSize" data-action="menu"><i class="md-icon">' + AppInfo.moreIcon.replace('-', '_') + '</i></button>';
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
|
|
|
@ -246,34 +246,6 @@
|
|||
});
|
||||
}
|
||||
|
||||
function onListViewPlayButtonClick(e, playButton) {
|
||||
|
||||
var card = e.target;
|
||||
|
||||
if (!card.classList.contains('card') && !card.classList.contains('listItem')) {
|
||||
card = parentWithAnyClass(card, ['listItem', 'card']);
|
||||
}
|
||||
|
||||
var id = card.getAttribute('data-itemid');
|
||||
var type = card.getAttribute('data-itemtype');
|
||||
var isFolder = card.getAttribute('data-isfolder') == 'true';
|
||||
var mediaType = card.getAttribute('data-mediatype');
|
||||
var resumePosition = parseInt(card.getAttribute('data-positionticks'));
|
||||
|
||||
if (type == 'MusicAlbum' || type == 'MusicArtist' || type == 'MusicGenre' || type == 'Playlist') {
|
||||
isFolder = true;
|
||||
}
|
||||
|
||||
if (type == 'Program') {
|
||||
id = card.getAttribute('data-channelid');
|
||||
}
|
||||
|
||||
LibraryBrowser.showPlayMenu(playButton, id, type, isFolder, mediaType, resumePosition);
|
||||
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
function isClickable(target) {
|
||||
|
||||
while (target != null) {
|
||||
|
@ -291,12 +263,6 @@
|
|||
|
||||
function onCardClick(e) {
|
||||
|
||||
var playButton = parentWithClass(e.target, 'cardOverlayPlayButton');
|
||||
|
||||
if (playButton) {
|
||||
return onListViewPlayButtonClick(e, playButton);
|
||||
}
|
||||
|
||||
var card = parentWithClass(e.target, 'card');
|
||||
|
||||
if (card) {
|
||||
|
|
|
@ -1820,6 +1820,7 @@ var AppInfo = {};
|
|||
define("subtitleEditor", [embyWebComponentsBowerPath + "/subtitleeditor/subtitleeditor"], returnFirstDependency);
|
||||
define("mediaInfo", [embyWebComponentsBowerPath + "/mediainfo/mediainfo"], returnFirstDependency);
|
||||
define("itemContextMenu", [embyWebComponentsBowerPath + "/itemcontextmenu"], returnFirstDependency);
|
||||
define("playMenu", [embyWebComponentsBowerPath + "/playmenu"], returnFirstDependency);
|
||||
define("refreshDialog", [embyWebComponentsBowerPath + "/refreshdialog/refreshdialog"], returnFirstDependency);
|
||||
define("backdrop", [embyWebComponentsBowerPath + "/backdrop/backdrop"], returnFirstDependency);
|
||||
define("fetchHelper", [embyWebComponentsBowerPath + "/fetchhelper"], returnFirstDependency);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue