diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 38b9542e2d..31a090ec10 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -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,7 +809,12 @@ } if (PlaylistManager.supportsPlaylists(item)) { - itemCommands.push('playlist'); + + if (options.showRemoveFromPlaylist) { + itemCommands.push('removefromplaylist'); + } else { + itemCommands.push('playlist'); + } } return itemCommands; diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index 1df4c7314b..26720e800a 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -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 += '