Commit 8d9e7de5 authored by Eva Bardou's avatar Eva Bardou
Browse files

Remove last emission (delete-transcription)

parent deb8a6d0
......@@ -4,8 +4,7 @@
<div class="nav nav-tabs mb-3" id="nav-tab" role="tablist">
<slot></slot>
<extrainfo :object="object"
:document-name="documentName"
@delete-transcription="deleteTranscription">
:document-name="documentName">
</extrainfo>
<extranav :show="show"></extranav>
</div>
......@@ -146,17 +145,6 @@ export default {
}.bind(this));
}.bind(this));
},
methods: {
async deleteTranscription(ev) {
let transcription = ev.target.dataset.trpk;
// I lied, it's only archived
if(confirm("Are you sure you want to delete the transcription?")) {
await this.$store.dispatch('transcriptions/archive', transcription)
ev.target.parentNode.remove(); // meh
this.$store.commit('transcriptions/removeComparedTranscription', transcription);
}
},
}
}
</script>
......
......@@ -46,8 +46,7 @@
v-bind:value="trans.pk" />
<label v-bind:for="'opt'+trans.pk"
class="form-check-label col">{{ trans.name }}</label>
<button v-bind:disabled="trans.pk == $store.state.transcriptions.selectedTranscription"
v-bind:data-trPk="trans.pk"
<button v-bind:data-trPk="trans.pk"
@click="deleteTranscription"
class="btn btn-danger fas fa-trash"
title="Completely remove the transcription and all of it's content!&#10;You can not remove the manual or the current transcription."></button>
......@@ -69,9 +68,15 @@ export default {
},
},
methods: {
deleteTranscription(ev) {
this.$emit('delete-transcription', ev)
}
async deleteTranscription(ev) {
let transcription = ev.target.dataset.trpk;
// I lied, it's only archived
if(confirm("Are you sure you want to delete the transcription?")) {
await this.$store.dispatch('transcriptions/archive', transcription);
ev.target.parentNode.remove(); // meh
this.$store.commit('transcriptions/removeComparedTranscription', transcription);
}
},
}
}
</script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment