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