Skip to content

Commit

Permalink
Add spinning loader (from lux!) to track detach button
Browse files Browse the repository at this point in the history
closes #2426
  • Loading branch information
hackartisan committed Feb 5, 2019
1 parent 85606b7 commit f2a6cb6
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions app/javascript/components/playlist_member.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<template>
<tr>
<td>{{ resource.label[0] }} (<a :href="`${resource.recording_url}`">{{ resource.recording_title }}</a>)</td>
<td>
{{ resource.label[0] }} (<a :href="`${resource.recording_url}`">
{{ resource.recording_title }}
</a>)
</td>
<td>
<button
class="btn btn-danger"
@click="$emit('update', id)"
class="btn btn-danger detach-btn"
@click="detach($event)"
>
Detach
<loader size="x-small" v-if="detachClicked" wrapper="span"></loader> Detach
</button>
</td>
</tr>
Expand All @@ -25,10 +29,23 @@ export default {
// This is due to the fact that Valkyrie::ID objects are not serialized as strings
const resourceId = this.resource.id
return {
id: resourceId.id
id: resourceId.id,
detachClicked: false
}
},
methods: {
detach: function (event) {
this.detachClicked = true
this.$emit('update', this.id)
}
}
}
</script>
<style scope>
.lux-loader {
display: inline-block;
}
.detach-btn {
width: 150px;
}
</style>

0 comments on commit f2a6cb6

Please sign in to comment.