Reusable save/cancel buttons for new config editors

This commit is contained in:
Alicia Sykes
2021-10-26 17:01:36 +01:00
parent 70ebce4da7
commit 6bdc4fe313
10 changed files with 131 additions and 82 deletions

View File

@@ -238,8 +238,12 @@ export default {
},
/* Deletes current section, in local state */
removeSection() {
const payload = { sectionIndex: this.index, sectionName: this.title };
this.$store.commit(StoreKeys.REMOVE_SECTION, payload);
const confirmMsg = this.$t('interactive-editor.edit-section.remove-confirm');
const youSure = confirm(confirmMsg); // eslint-disable-line no-alert, no-restricted-globals
if (youSure) {
const payload = { sectionIndex: this.index, sectionName: this.title };
this.$store.commit(StoreKeys.REMOVE_SECTION, payload);
}
this.closeContextMenu();
},
/* Open custom context menu, and set position */