working on move playlist
This commit is contained in:
parent
b9d2c81fd2
commit
b1f36c6e48
3 changed files with 101 additions and 26 deletions
|
@ -37,10 +37,17 @@ var CiderContextMenu = {
|
|||
|
||||
document.body.appendChild(menuBackground);
|
||||
|
||||
if(typeof menudata.items == "object") {
|
||||
menudata.items = Object.values(menudata.items);
|
||||
}
|
||||
|
||||
// for each item in menudata create a menu item
|
||||
for (var i = 0; i < menudata.items.length; i++) {
|
||||
let item = document.createElement("button")
|
||||
|
||||
if(menudata.items[i]["disabled"]) {
|
||||
break
|
||||
}
|
||||
item.tabIndex = 0
|
||||
item.classList.add("context-menu-item")
|
||||
item.innerHTML = menudata.items[i].name
|
||||
|
@ -644,25 +651,6 @@ const app = new Vue({
|
|||
}
|
||||
CiderContextMenu.Create(event, menu)
|
||||
},
|
||||
playlistContextMenu(event, playlist_id) {
|
||||
let menu = {
|
||||
items: [
|
||||
{
|
||||
name: "Delete from library",
|
||||
action: () => {
|
||||
this.deletePlaylist(playlist_id)
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "Add to favorites",
|
||||
action: () => {
|
||||
this.addFavorite(playlist_id, "library-playlists")
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
CiderContextMenu.Create(event, menu)
|
||||
},
|
||||
async editPlaylist(id, name = "New Playlist") {
|
||||
let self = this
|
||||
await app.mk.api.library.editPlaylist(id, { name: name }).then(res => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue