mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
implement removing from playlists
This commit is contained in:
parent
a9e5a73d42
commit
6f781f5a96
5 changed files with 43 additions and 11 deletions
|
@ -809,26 +809,36 @@ progress {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 440px;
|
width: 440px;
|
||||||
margin-left: 2em;
|
margin-left: 2em;
|
||||||
|
min-width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.firstDashboardHomeRightColumn .ui-collapsible-content {
|
.firstDashboardHomeRightColumn .ui-collapsible-content {
|
||||||
height: 585px;
|
height: 585px;
|
||||||
min-width: 300px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 1920px) {
|
@media all and (min-width: 1580px) {
|
||||||
|
|
||||||
.dashboardHomeRightColumn {
|
.dashboardHomeRightColumn {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
margin-left: 1em;
|
||||||
|
width: 300px;
|
||||||
|
min-width: 300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dashboardHomeRightColumn .ui-collapsible-content {
|
||||||
|
height: auto;
|
||||||
|
min-height: 585px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media all and (min-width: 1880px) {
|
||||||
|
|
||||||
|
.dashboardHomeRightColumn {
|
||||||
max-width: 440px;
|
max-width: 440px;
|
||||||
margin-left: 2em;
|
margin-left: 2em;
|
||||||
min-width: 400px;
|
min-width: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dashboardHomeRightColumn .ui-collapsible-content {
|
|
||||||
height: 585px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.organizerButtonCell {
|
.organizerButtonCell {
|
||||||
|
|
|
@ -1131,7 +1131,7 @@ $(document).on('pagebeforeshow', "#dashboardPage", DashboardPage.onPageShow)
|
||||||
var name = $('.notificationName', item).html();
|
var name = $('.notificationName', item).html();
|
||||||
|
|
||||||
Dashboard.alert({
|
Dashboard.alert({
|
||||||
message: overview,
|
message: '<div style="max-height:300px; overflow: auto;">' + overview + '</div>',
|
||||||
title: name
|
title: name
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -690,7 +690,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var href = LibraryBrowser.getHref(item, options.context);
|
var href = LibraryBrowser.getHref(item, options.context);
|
||||||
html += '<li class="' + cssClass + '"' + dataAttributes + ' data-itemid="' + item.Id + '" data-href="' + href + '"><a href="' + href + '">';
|
html += '<li class="' + cssClass + '"' + dataAttributes + ' data-itemid="' + item.Id + '" data-playlistitemid="' + (item.PlaylistItemId || '') + '" data-href="' + href + '"><a href="' + href + '">';
|
||||||
|
|
||||||
var imgUrl;
|
var imgUrl;
|
||||||
|
|
||||||
|
|
|
@ -178,11 +178,11 @@
|
||||||
|
|
||||||
function onRemoveFromPlaylistButtonClick() {
|
function onRemoveFromPlaylistButtonClick() {
|
||||||
|
|
||||||
var id = this.getAttribute('data-itemid');
|
var playlistItemId = this.getAttribute('data-playlistitemid');
|
||||||
|
|
||||||
var page = $(this).parents('.page');
|
var page = $(this).parents('.page');
|
||||||
|
|
||||||
$('.itemsContainer', page).trigger('needsrefresh');
|
$('.itemsContainer', page).trigger('removefromplaylist', [playlistItemId]);
|
||||||
|
|
||||||
// Used by the tab menu, not the slide up
|
// Used by the tab menu, not the slide up
|
||||||
$('.tapHoldMenu').popup('close');
|
$('.tapHoldMenu').popup('close');
|
||||||
|
@ -272,6 +272,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var itemId = card.getAttribute('data-itemid');
|
var itemId = card.getAttribute('data-itemid');
|
||||||
|
var playlistItemId = card.getAttribute('data-playlistitemid');
|
||||||
var commands = card.getAttribute('data-commands').split(',');
|
var commands = card.getAttribute('data-commands').split(',');
|
||||||
var itemType = card.getAttribute('data-itemtype');
|
var itemType = card.getAttribute('data-itemtype');
|
||||||
var mediaType = card.getAttribute('data-mediatype');
|
var mediaType = card.getAttribute('data-mediatype');
|
||||||
|
@ -327,7 +328,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commands.indexOf('removefromplaylist') != -1) {
|
if (commands.indexOf('removefromplaylist') != -1) {
|
||||||
html += '<li data-icon="delete"><a href="#" class="btnRemoveFromPlaylist" data-itemid="' + itemId + '">' + Globalize.translate('ButtonRemoveFromPlaylist') + '</a></li>';
|
html += '<li data-icon="delete"><a href="#" class="btnRemoveFromPlaylist" data-playlistitemid="' + playlistItemId + '">' + Globalize.translate('ButtonRemoveFromPlaylist') + '</a></li>';
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '</ul>';
|
html += '</ul>';
|
||||||
|
|
|
@ -104,6 +104,23 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function removeFromPlaylist(page, ids) {
|
||||||
|
|
||||||
|
ApiClient.ajax({
|
||||||
|
|
||||||
|
url: ApiClient.getUrl('Playlists/' + currentItem.Id + '/Items', {
|
||||||
|
EntryIds: ids.join(',')
|
||||||
|
}),
|
||||||
|
|
||||||
|
type: 'DELETE'
|
||||||
|
|
||||||
|
}).done(function () {
|
||||||
|
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function updateFilterControls(page) {
|
function updateFilterControls(page) {
|
||||||
|
|
||||||
// Reset form values using the last used query
|
// Reset form values using the last used query
|
||||||
|
@ -159,6 +176,10 @@
|
||||||
|
|
||||||
reloadItems(page);
|
reloadItems(page);
|
||||||
|
|
||||||
|
}).on('removefromplaylist', function (e, playlistItemId) {
|
||||||
|
|
||||||
|
removeFromPlaylist(page, [playlistItemId]);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pagebeforeshow', "#playlistEditorPage", function () {
|
}).on('pagebeforeshow', "#playlistEditorPage", function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue