Made button go back to normal after 3 seconds
This commit is contained in:
parent
e73eeb2a2c
commit
81294b0d1f
1 changed files with 11 additions and 2 deletions
|
@ -67,7 +67,7 @@
|
||||||
Shuffle
|
Shuffle
|
||||||
</button>
|
</button>
|
||||||
<button class="wr-btn" style="min-width: 120px;" v-if="inLibrary!=null && confirm!=true"
|
<button class="wr-btn" style="min-width: 120px;" v-if="inLibrary!=null && confirm!=true"
|
||||||
@click="confirm = true">
|
@click="confirmButton()">
|
||||||
{{ (!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"
|
<button class="wr-btn" style="min-width: 120px;" v-if="confirm==true"
|
||||||
|
@ -113,10 +113,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
Vue.component('cider-playlist', {
|
Vue.component('cider-playlist', {
|
||||||
template: "#cider-playlist",
|
template: "#cider-playlist",
|
||||||
props: ["data"],
|
props: ["data"],
|
||||||
|
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
editorialNotesExpanded: false,
|
editorialNotesExpanded: false,
|
||||||
|
@ -166,6 +168,13 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
confirmButton() {
|
||||||
|
// Return button to normal state after 3 seconds
|
||||||
|
|
||||||
|
this.confirm = true
|
||||||
|
setTimeout(() => this.confirm = false, 3000);
|
||||||
|
},
|
||||||
|
|
||||||
getDescription(data) {
|
getDescription(data) {
|
||||||
console.log(data.attributes)
|
console.log(data.attributes)
|
||||||
if (data.attributes.editorialNotes) {
|
if (data.attributes.editorialNotes) {
|
||||||
|
@ -334,7 +343,7 @@
|
||||||
var kind = this.data.attributes.playParams.kind ?? this.data.type ?? '';
|
var kind = this.data.attributes.playParams.kind ?? this.data.type ?? '';
|
||||||
//console.log("1")
|
//console.log("1")
|
||||||
var truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
|
var truekind = (!kind.endsWith("s")) ? (kind + "s") : kind;
|
||||||
|
|
||||||
let query = (this.data ?? app.showingPlaylist).relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
|
let query = (this.data ?? app.showingPlaylist).relationships.tracks.data.map(item => new MusicKit.MediaItem(item));
|
||||||
app.mk.stop().then(function () {
|
app.mk.stop().then(function () {
|
||||||
app.mk.setQueue({[truekind]: [id]}).then(function () {
|
app.mk.setQueue({[truekind]: [id]}).then(function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue