Made button go back to normal after 3 seconds

This commit is contained in:
Swiftzerr 2022-01-11 21:26:15 -05:00
parent e73eeb2a2c
commit 81294b0d1f

View file

@ -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) {