edit playlist name added
This commit is contained in:
parent
17e24d4e4f
commit
153370c32d
3 changed files with 29 additions and 2 deletions
|
@ -454,6 +454,7 @@ const app = new Vue({
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
async editPlaylist(id, name = "New Playlist") {
|
async editPlaylist(id, name = "New Playlist") {
|
||||||
|
let self = this
|
||||||
await app.mk.api.library.editPlaylist(id, {name: name}).then(res => {
|
await app.mk.api.library.editPlaylist(id, {name: name}).then(res => {
|
||||||
self.refreshPlaylists()
|
self.refreshPlaylists()
|
||||||
})
|
})
|
||||||
|
|
|
@ -1770,6 +1770,18 @@ input[type="range"].web-slider.display--small::-webkit-slider-thumb {
|
||||||
flex-shrink: unset;
|
flex-shrink: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nameEdit {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 1.6rem;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
margin-right: 6px;
|
||||||
|
flex-shrink: unset;
|
||||||
|
background: transparent;
|
||||||
|
border: 0px;
|
||||||
|
color: inherit;
|
||||||
|
font-family: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
.playlist-artist {
|
.playlist-artist {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-size: 1.6rem;
|
font-size: 1.6rem;
|
||||||
|
|
|
@ -22,9 +22,10 @@
|
||||||
<div class="col playlist-info">
|
<div class="col playlist-info">
|
||||||
<template v-if="!editorialNotesExpanded">
|
<template v-if="!editorialNotesExpanded">
|
||||||
<div>
|
<div>
|
||||||
<div class="playlist-name">{{data.attributes ? (data.attributes.name ??
|
<div class="playlist-name" @click="editPlaylistName()" v-show="!nameEditing">{{data.attributes ? (data.attributes.name ??
|
||||||
(data.attributes.title ?? '') ?? '') : ''}}
|
(data.attributes.title ?? '') ?? '') : ''}}
|
||||||
</div>
|
</div>
|
||||||
|
<div class="playlist-name" v-show="nameEditing"><input type="text" spellcheck="false" class="nameEdit" v-model="data.attributes.name" @blur="editPlaylist" @change="editPlaylist" @keydown.enter="editPlaylist"/></div>
|
||||||
<div class="playlist-artist item-navigate" v-if="data.attributes && data.attributes.artistName" @click="if(data.attributes && data.attributes.artistName){ app.searchAndNavigate(data,'artist')}">
|
<div class="playlist-artist item-navigate" v-if="data.attributes && data.attributes.artistName" @click="if(data.attributes && data.attributes.artistName){ app.searchAndNavigate(data,'artist')}">
|
||||||
{{data.attributes ? (data.attributes.artistName ?? '') :''}}
|
{{data.attributes ? (data.attributes.artistName ?? '') :''}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -87,13 +88,26 @@
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
editorialNotesExpanded: false,
|
editorialNotesExpanded: false,
|
||||||
drag: false
|
drag: false,
|
||||||
|
nameEditing: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
editPlaylist() {
|
||||||
|
app.editPlaylist(this.data.id, this.data.attributes.name);
|
||||||
|
this.nameEditing = false
|
||||||
|
},
|
||||||
|
editPlaylistName() {
|
||||||
|
if(this.data.attributes.canEdit && this.data.type == "library-playlists") {
|
||||||
|
this.nameEditing = true
|
||||||
|
setTimeout(() => {
|
||||||
|
document.querySelector(".nameEdit").focus()
|
||||||
|
}, 100)
|
||||||
|
}
|
||||||
|
},
|
||||||
buildContextMenu (index) {
|
buildContextMenu (index) {
|
||||||
let self = this
|
let self = this
|
||||||
if(!this.data.attributes.canEdit) {
|
if(!this.data.attributes.canEdit) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue