1
0
Fork 0
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:
Luke Pulverenti 2014-08-11 19:41:11 -04:00
parent a9e5a73d42
commit 6f781f5a96
5 changed files with 43 additions and 11 deletions

View file

@ -809,25 +809,35 @@ progress {
display: inline-block;
width: 440px;
margin-left: 2em;
min-width: 300px;
}
.firstDashboardHomeRightColumn .ui-collapsible-content {
height: 585px;
min-width: 300px;
}
}
@media all and (min-width: 1920px) {
@media all and (min-width: 1580px) {
.dashboardHomeRightColumn {
display: inline-block;
max-width: 440px;
margin-left: 2em;
min-width: 400px;
margin-left: 1em;
width: 300px;
min-width: 300px;
}
.dashboardHomeRightColumn .ui-collapsible-content {
height: 585px;
height: auto;
min-height: 585px;
}
}
@media all and (min-width: 1880px) {
.dashboardHomeRightColumn {
max-width: 440px;
margin-left: 2em;
min-width: 400px;
}
}

View file

@ -1131,7 +1131,7 @@ $(document).on('pagebeforeshow', "#dashboardPage", DashboardPage.onPageShow)
var name = $('.notificationName', item).html();
Dashboard.alert({
message: overview,
message: '<div style="max-height:300px; overflow: auto;">' + overview + '</div>',
title: name
});
});

View file

@ -690,7 +690,7 @@
}
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;

View file

@ -178,11 +178,11 @@
function onRemoveFromPlaylistButtonClick() {
var id = this.getAttribute('data-itemid');
var playlistItemId = this.getAttribute('data-playlistitemid');
var page = $(this).parents('.page');
$('.itemsContainer', page).trigger('needsrefresh');
$('.itemsContainer', page).trigger('removefromplaylist', [playlistItemId]);
// Used by the tab menu, not the slide up
$('.tapHoldMenu').popup('close');
@ -272,6 +272,7 @@
}
var itemId = card.getAttribute('data-itemid');
var playlistItemId = card.getAttribute('data-playlistitemid');
var commands = card.getAttribute('data-commands').split(',');
var itemType = card.getAttribute('data-itemtype');
var mediaType = card.getAttribute('data-mediatype');
@ -327,7 +328,7 @@
}
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>';

View file

@ -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) {
// Reset form values using the last used query
@ -159,6 +176,10 @@
reloadItems(page);
}).on('removefromplaylist', function (e, playlistItemId) {
removeFromPlaylist(page, [playlistItemId]);
});
}).on('pagebeforeshow', "#playlistEditorPage", function () {