Commit 0fc45b6c authored by Fatih Acet's avatar Fatih Acet

IssueNotesRefactor: Reenable button after failed submit attempt.

parent 19f77cab
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
}); });
} }
}, },
formUpdateHandler(noteText, parentElement) { formUpdateHandler(noteText, parentElement, callback) {
const data = { const data = {
endpoint: this.note.path, endpoint: this.note.path,
note: { note: {
...@@ -94,7 +94,8 @@ ...@@ -94,7 +94,8 @@
'Something went wrong while editing your comment. Please try again.', 'Something went wrong while editing your comment. Please try again.',
'alert', 'alert',
$(parentElement), $(parentElement),
)); ))
.then(callback);
}, },
formCancelHandler(shouldConfirm, isDirty) { formCancelHandler(shouldConfirm, isDirty) {
if (shouldConfirm && isDirty) { if (shouldConfirm && isDirty) {
......
...@@ -49,8 +49,8 @@ ...@@ -49,8 +49,8 @@
}); });
} }
}, },
handleFormUpdate(note, parentElement) { handleFormUpdate(note, parentElement, callback) {
this.$emit('handleFormUpdate', note, parentElement); this.$emit('handleFormUpdate', note, parentElement, callback);
}, },
formCancelHandler(shouldConfirm, isDirty) { formCancelHandler(shouldConfirm, isDirty) {
this.$emit('cancelFormEdition', shouldConfirm, isDirty); this.$emit('cancelFormEdition', shouldConfirm, isDirty);
......
...@@ -74,7 +74,10 @@ ...@@ -74,7 +74,10 @@
methods: { methods: {
handleUpdate() { handleUpdate() {
this.isSubmitting = true; this.isSubmitting = true;
this.$emit('handleFormUpdate', this.note, this.$refs.editNoteForm);
this.$emit('handleFormUpdate', this.note, this.$refs.editNoteForm, () => {
this.isSubmitting = false;
});
}, },
editMyLastNote() { editMyLastNote() {
if (this.note === '') { if (this.note === '') {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment