mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
updated nuget
This commit is contained in:
parent
7d87624880
commit
230add1e17
3 changed files with 35 additions and 4 deletions
|
@ -759,7 +759,7 @@
|
||||||
|
|
||||||
var atts = [];
|
var atts = [];
|
||||||
|
|
||||||
var itemCommands = LibraryBrowser.getItemCommands(item);
|
var itemCommands = LibraryBrowser.getItemCommands(item, options);
|
||||||
|
|
||||||
atts.push('data-itemid="' + item.Id + '"');
|
atts.push('data-itemid="' + item.Id + '"');
|
||||||
atts.push('data-commands="' + itemCommands.join(',') + '"');
|
atts.push('data-commands="' + itemCommands.join(',') + '"');
|
||||||
|
@ -784,7 +784,7 @@
|
||||||
return html;
|
return html;
|
||||||
},
|
},
|
||||||
|
|
||||||
getItemCommands: function (item) {
|
getItemCommands: function (item, options) {
|
||||||
|
|
||||||
var itemCommands = [];
|
var itemCommands = [];
|
||||||
|
|
||||||
|
@ -809,8 +809,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PlaylistManager.supportsPlaylists(item)) {
|
if (PlaylistManager.supportsPlaylists(item)) {
|
||||||
|
|
||||||
|
if (options.showRemoveFromPlaylist) {
|
||||||
|
itemCommands.push('removefromplaylist');
|
||||||
|
} else {
|
||||||
itemCommands.push('playlist');
|
itemCommands.push('playlist');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return itemCommands;
|
return itemCommands;
|
||||||
},
|
},
|
||||||
|
|
|
@ -161,6 +161,20 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onRemoveFromPlaylistButtonClick() {
|
||||||
|
|
||||||
|
var id = this.getAttribute('data-itemid');
|
||||||
|
|
||||||
|
var page = $(this).parents('.page');
|
||||||
|
|
||||||
|
$('.itemsContainer', page).trigger('needsrefresh');
|
||||||
|
|
||||||
|
// Used by the tab menu, not the slide up
|
||||||
|
$('.tapHoldMenu').popup('close');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
function onShuffleButtonClick() {
|
function onShuffleButtonClick() {
|
||||||
|
|
||||||
var id = this.getAttribute('data-itemid');
|
var id = this.getAttribute('data-itemid');
|
||||||
|
@ -297,6 +311,10 @@
|
||||||
html += '<li data-icon="plus"><a href="#" class="btnAddToPlaylist" data-itemid="' + itemId + '">' + Globalize.translate('ButtonAddToPlaylist') + '</a></li>';
|
html += '<li data-icon="plus"><a href="#" class="btnAddToPlaylist" data-itemid="' + itemId + '">' + Globalize.translate('ButtonAddToPlaylist') + '</a></li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (commands.indexOf('removefromplaylist') != -1) {
|
||||||
|
html += '<li data-icon="delete"><a href="#" class="btnRemoveFromPlaylist" data-itemid="' + itemId + '">' + Globalize.translate('ButtonRemoveFromPlaylist') + '</a></li>';
|
||||||
|
}
|
||||||
|
|
||||||
html += '</ul>';
|
html += '</ul>';
|
||||||
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
@ -316,6 +334,7 @@
|
||||||
$('.btnShuffle', elem).on('click', onShuffleButtonClick);
|
$('.btnShuffle', elem).on('click', onShuffleButtonClick);
|
||||||
$('.btnPlayTrailer', elem).on('click', onTrailerButtonClick);
|
$('.btnPlayTrailer', elem).on('click', onTrailerButtonClick);
|
||||||
$('.btnAddToPlaylist', elem).on('click', onAddToPlaylistButtonClick);
|
$('.btnAddToPlaylist', elem).on('click', onAddToPlaylistButtonClick);
|
||||||
|
$('.btnRemoveFromPlaylist', elem).on('click', onRemoveFromPlaylistButtonClick);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,8 @@
|
||||||
context: 'playlists',
|
context: 'playlists',
|
||||||
sortBy: query.SortBy,
|
sortBy: query.SortBy,
|
||||||
showIndex: false,
|
showIndex: false,
|
||||||
title: item.Name
|
title: item.Name,
|
||||||
|
showRemoveFromPlaylist: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,6 +155,12 @@
|
||||||
LibraryBrowser.showPlayMenu(this, currentItem.Id, currentItem.Type, currentItem.IsFolder, mediaType, userdata.PlaybackPositionTicks);
|
LibraryBrowser.showPlayMenu(this, currentItem.Id, currentItem.Type, currentItem.IsFolder, mediaType, userdata.PlaybackPositionTicks);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('.itemsContainer', page).on('needsrefresh', function () {
|
||||||
|
|
||||||
|
reloadItems(page);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
}).on('pagebeforeshow', "#playlistEditorPage", function () {
|
}).on('pagebeforeshow', "#playlistEditorPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue