added share to some elements, does not work correctly for library songs yet
This commit is contained in:
parent
04956a5590
commit
ee4a2e4751
4 changed files with 23 additions and 2 deletions
|
@ -613,6 +613,9 @@ const app = new Vue({
|
|||
self.refreshPlaylists()
|
||||
})
|
||||
},
|
||||
copyToClipboard(str) {
|
||||
navigator.clipboard.writeText(str)
|
||||
},
|
||||
newPlaylist(name = "New Playlist", tracks = []) {
|
||||
let self = this
|
||||
let request = {
|
||||
|
|
|
@ -276,6 +276,12 @@
|
|||
app.searchAndNavigate(self.item, 'album')
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Share",
|
||||
"action": function () {
|
||||
self.app.copyToClipboard(self.item.attributes.url)
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -215,6 +215,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"id": "addToPlaylist",
|
||||
"name": "Add to Playlist...",
|
||||
"action": function () {
|
||||
app.promptAddToPlaylist()
|
||||
|
@ -237,11 +238,20 @@
|
|||
;
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Share",
|
||||
"action": function () {
|
||||
self.app.copyToClipboard(self.item.attributes.url)
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
if ((self.item.attributes.playParams.kind ?? self.item.type).includes("playlist")) {
|
||||
menus.normal.items.splice(2, 1);
|
||||
// remove the add to playlist option by id "addToPlaylist" using the .filter() method
|
||||
menus.normal.items = menus.normal.items.filter(function (item) {
|
||||
return item.id != "addToPlaylist"
|
||||
})
|
||||
}
|
||||
if (this.contextExt) {
|
||||
if (this.contextExt.normal) {
|
||||
|
|
|
@ -169,7 +169,9 @@
|
|||
followActions[followAction],
|
||||
{
|
||||
name: "Share",
|
||||
action: ()=>{}
|
||||
action: ()=>{
|
||||
self.app.copyToClipboard(self.data.attributes.url)
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue