1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

updated nuget

This commit is contained in:
Luke Pulverenti 2014-08-06 00:18:13 -04:00
parent 7d87624880
commit 230add1e17
3 changed files with 35 additions and 4 deletions

View file

@ -759,7 +759,7 @@
var atts = [];
var itemCommands = LibraryBrowser.getItemCommands(item);
var itemCommands = LibraryBrowser.getItemCommands(item, options);
atts.push('data-itemid="' + item.Id + '"');
atts.push('data-commands="' + itemCommands.join(',') + '"');
@ -784,7 +784,7 @@
return html;
},
getItemCommands: function (item) {
getItemCommands: function (item, options) {
var itemCommands = [];
@ -809,8 +809,13 @@
}
if (PlaylistManager.supportsPlaylists(item)) {
if (options.showRemoveFromPlaylist) {
itemCommands.push('removefromplaylist');
} else {
itemCommands.push('playlist');
}
}
return itemCommands;
},

View file

@ -161,6 +161,20 @@
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() {
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>';
}
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 += '</div>';
@ -316,6 +334,7 @@
$('.btnShuffle', elem).on('click', onShuffleButtonClick);
$('.btnPlayTrailer', elem).on('click', onTrailerButtonClick);
$('.btnAddToPlaylist', elem).on('click', onAddToPlaylistButtonClick);
$('.btnRemoveFromPlaylist', elem).on('click', onRemoveFromPlaylistButtonClick);
});
}

View file

@ -73,7 +73,8 @@
context: 'playlists',
sortBy: query.SortBy,
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);
});
$('.itemsContainer', page).on('needsrefresh', function () {
reloadItems(page);
});
}).on('pagebeforeshow', "#playlistEditorPage", function () {
var page = this;