Added global event listeners to task submitters

This commit is contained in:
Joel Collins 2020-07-06 10:34:00 +01:00
parent 2b9bec24f1
commit 9cf491aeb0
2 changed files with 27 additions and 2 deletions

View file

@ -78,7 +78,12 @@ export default {
buttonPrimary: {
type: Boolean,
required: false,
default: false
default: true
},
submitOnEvent: {
type: String,
required: false,
default: null
}
},
@ -101,7 +106,20 @@ export default {
created() {},
beforeDestroy() {},
mounted() {
// A global signal listener to perform a move action
if (this.submitOnEvent) {
this.$root.$on(this.submitOnEvent, () => {
this.bootstrapTask();
});
}
},
beforeDestroy() {
if (this.submitOnEvent) {
this.$root.$off(this.submitOnEvent);
}
},
methods: {
bootstrapTask: function() {