提交 6becf288 编写于 作者: P Phil Hughes

use formState to update loading of save button

[ci skip]
上级 3ce6658d
......@@ -114,6 +114,7 @@ export default {
description: this.state.descriptionText,
lockedWarningVisible: false,
move_to_project_id: 0,
updateLoading: false,
});
}
},
......@@ -125,7 +126,7 @@ export default {
confirm('Are you sure you want to move this issue to another project?') : true; // eslint-disable-line no-alert
if (!canPostUpdate) {
eventHub.$emit('enable.submit.btn');
this.store.formState.updateLoading = false;
return;
}
......
......@@ -15,7 +15,6 @@
data() {
return {
deleteLoading: false,
updateLoading: false,
};
},
computed: {
......@@ -24,11 +23,8 @@
},
},
methods: {
enableSubmit() {
this.updateLoading = false;
},
updateIssuable() {
this.updateLoading = true;
this.formState.updateLoading = true;
eventHub.$emit('update.issuable');
},
closeForm() {
......@@ -43,12 +39,6 @@
}
},
},
created() {
eventHub.$on('enable.submit.btn', this.enableSubmit);
},
beforeDestroy() {
eventHub.$off('enable.submit.btn', this.enableSubmit);
},
};
</script>
......@@ -56,15 +46,15 @@
<div class="prepend-top-default append-bottom-default clearfix">
<button
class="btn btn-save pull-left"
:class="{ disabled: updateLoading || !isSubmitEnabled }"
:class="{ disabled: formState.updateLoading || !isSubmitEnabled }"
type="submit"
:disabled="updateLoading || !isSubmitEnabled"
:disabled="formState.updateLoading || !isSubmitEnabled"
@click.prevent="updateIssuable">
Save changes
<i
class="fa fa-spinner fa-spin"
aria-hidden="true"
v-if="updateLoading">
v-if="formState.updateLoading">
</i>
</button>
<button
......
......@@ -19,6 +19,7 @@ export default class Store {
description: '',
lockedWarningVisible: false,
move_to_project_id: 0,
updateLoading: false,
};
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册