Added a confirm button to Remove/Add to Libary
This commit is contained in:
parent
0e55ca0f3c
commit
e73eeb2a2c
1 changed files with 9 additions and 2 deletions
|
@ -66,10 +66,14 @@
|
||||||
@click="app.mk.shuffleMode = 1;play()">
|
@click="app.mk.shuffleMode = 1;play()">
|
||||||
Shuffle
|
Shuffle
|
||||||
</button>
|
</button>
|
||||||
<button class="wr-btn" style="min-width: 120px;" v-if="inLibrary!=null"
|
<button class="wr-btn" style="min-width: 120px;" v-if="inLibrary!=null && confirm!=true"
|
||||||
@click="(!inLibrary) ? addToLibrary(data.attributes.playParams.id.toString()) : removeFromLibrary(data.attributes.playParams.id.toString())">
|
@click="confirm = true">
|
||||||
{{ (!inLibrary) ? "Add to Library" : "Remove from Library" }}
|
{{ (!inLibrary) ? "Add to Library" : "Remove from Library" }}
|
||||||
</button>
|
</button>
|
||||||
|
<button class="wr-btn" style="min-width: 120px;" v-if="confirm==true"
|
||||||
|
@click="(!inLibrary) ? addToLibrary(data.attributes.playParams.id.toString()) : removeFromLibrary(data.attributes.playParams.id.toString()) ">
|
||||||
|
Confirm?
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -119,6 +123,7 @@
|
||||||
drag: false,
|
drag: false,
|
||||||
nameEditing: false,
|
nameEditing: false,
|
||||||
inLibrary: null,
|
inLibrary: null,
|
||||||
|
confirm: false,
|
||||||
app: this.$root,
|
app: this.$root,
|
||||||
itemBadges: [],
|
itemBadges: [],
|
||||||
badgesRequested: false
|
badgesRequested: false
|
||||||
|
@ -212,6 +217,7 @@
|
||||||
addToLibrary(id) {
|
addToLibrary(id) {
|
||||||
app.mk.addToLibrary(id)
|
app.mk.addToLibrary(id)
|
||||||
this.inLibrary = true
|
this.inLibrary = true
|
||||||
|
this.confirm = false
|
||||||
},
|
},
|
||||||
async removeFromLibrary(id) {
|
async removeFromLibrary(id) {
|
||||||
var params = { "fields[somgs]": "inLibrary", "fields[albums]": "inLibrary", "relate": "library" }
|
var params = { "fields[somgs]": "inLibrary", "fields[albums]": "inLibrary", "relate": "library" }
|
||||||
|
@ -224,6 +230,7 @@
|
||||||
var truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
|
var truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
|
||||||
app.mk.api.library.remove({ [truekind]: id })
|
app.mk.api.library.remove({ [truekind]: id })
|
||||||
this.inLibrary = false
|
this.inLibrary = false
|
||||||
|
this.confirm = false
|
||||||
},
|
},
|
||||||
editPlaylistName() {
|
editPlaylistName() {
|
||||||
if (this.data.attributes.canEdit && this.data.type == "library-playlists") {
|
if (this.data.attributes.canEdit && this.data.type == "library-playlists") {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue