IssueNotesRefactor: Reenable button after failed submit attempt.
This commit is contained in:
parent
19f77cab3e
commit
0fc45b6c19
3 changed files with 9 additions and 5 deletions
|
@ -73,7 +73,7 @@
|
|||
});
|
||||
}
|
||||
},
|
||||
formUpdateHandler(noteText, parentElement) {
|
||||
formUpdateHandler(noteText, parentElement, callback) {
|
||||
const data = {
|
||||
endpoint: this.note.path,
|
||||
note: {
|
||||
|
@ -94,7 +94,8 @@
|
|||
'Something went wrong while editing your comment. Please try again.',
|
||||
'alert',
|
||||
$(parentElement),
|
||||
));
|
||||
))
|
||||
.then(callback);
|
||||
},
|
||||
formCancelHandler(shouldConfirm, isDirty) {
|
||||
if (shouldConfirm && isDirty) {
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
});
|
||||
}
|
||||
},
|
||||
handleFormUpdate(note, parentElement) {
|
||||
this.$emit('handleFormUpdate', note, parentElement);
|
||||
handleFormUpdate(note, parentElement, callback) {
|
||||
this.$emit('handleFormUpdate', note, parentElement, callback);
|
||||
},
|
||||
formCancelHandler(shouldConfirm, isDirty) {
|
||||
this.$emit('cancelFormEdition', shouldConfirm, isDirty);
|
||||
|
|
|
@ -74,7 +74,10 @@
|
|||
methods: {
|
||||
handleUpdate() {
|
||||
this.isSubmitting = true;
|
||||
this.$emit('handleFormUpdate', this.note, this.$refs.editNoteForm);
|
||||
|
||||
this.$emit('handleFormUpdate', this.note, this.$refs.editNoteForm, () => {
|
||||
this.isSubmitting = false;
|
||||
});
|
||||
},
|
||||
editMyLastNote() {
|
||||
if (this.note === '') {
|
||||
|
|
Loading…
Reference in a new issue