Attract multi edit: Disable save button during save
This commit is contained in:
@@ -71,6 +71,7 @@ const TEMPLATE =`
|
||||
>
|
||||
<button class="btn btn-outline-success btn-block" id="item-save" type="submit"
|
||||
@click="save"
|
||||
:disabled="isSaving"
|
||||
>
|
||||
<i class="pi-check"/>Save Asset
|
||||
</button>
|
||||
|
@@ -72,6 +72,7 @@ const TEMPLATE =`
|
||||
>
|
||||
<button class="btn btn-outline-success btn-block" id="item-save" type="submit"
|
||||
@click="save"
|
||||
:disabled="isSaving"
|
||||
>
|
||||
<i class="pi-check"/>Save Shot
|
||||
</button>
|
||||
|
@@ -142,6 +142,7 @@ const TEMPLATE =`
|
||||
>
|
||||
<button class="btn btn-outline-success btn-block" id="item-save" type="submit"
|
||||
@click="save"
|
||||
:disabled="isSaving"
|
||||
>
|
||||
<i class="pi-check"/>
|
||||
Save Task
|
||||
|
@@ -24,6 +24,7 @@ let EditorBase = Vue.component('attract-editor-Base', {
|
||||
data() {
|
||||
return {
|
||||
multiEditEngine: this.createEditorEngine(ALL_BASE_PROPERTIES),
|
||||
isSaving: false,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -112,13 +113,14 @@ let EditorBase = Vue.component('attract-editor-Base', {
|
||||
save() {
|
||||
let toBeSaved = this.multiEditEngine.createUpdatedItems();
|
||||
let promises = toBeSaved.map(pillar.api.thenUpdateNode);
|
||||
|
||||
this.isSaving = true;
|
||||
this.unitOfWork(
|
||||
Promise.all(promises)
|
||||
.then(() => {
|
||||
this.$emit('saved-items');
|
||||
})
|
||||
.catch((err) => {toastr.error(pillar.utils.messageFromError(err), 'Save Failed')})
|
||||
.finally(() => this.isSaving = false)
|
||||
);
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user