diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-08-21 19:05:40 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-08-21 19:05:55 +0300 |
commit | 0fc45b6c19a89b196acafebf5295990b9100878b (patch) | |
tree | b3d267f09f5af37a71c9c274e5926cb8e53bde92 /app/assets/javascripts/notes | |
parent | 19f77cab3e6c564dcd99668db882aa61b5ef8dde (diff) |
IssueNotesRefactor: Reenable button after failed submit attempt.
Diffstat (limited to 'app/assets/javascripts/notes')
3 files changed, 9 insertions, 5 deletions
diff --git a/app/assets/javascripts/notes/components/issue_note.vue b/app/assets/javascripts/notes/components/issue_note.vue index 600142a6866..ff854664046 100644 --- a/app/assets/javascripts/notes/components/issue_note.vue +++ b/app/assets/javascripts/notes/components/issue_note.vue @@ -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) { diff --git a/app/assets/javascripts/notes/components/issue_note_body.vue b/app/assets/javascripts/notes/components/issue_note_body.vue index 8e35920e659..ec7ed4690ee 100644 --- a/app/assets/javascripts/notes/components/issue_note_body.vue +++ b/app/assets/javascripts/notes/components/issue_note_body.vue @@ -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); diff --git a/app/assets/javascripts/notes/components/issue_note_form.vue b/app/assets/javascripts/notes/components/issue_note_form.vue index 591008a0285..626c0f2ce18 100644 --- a/app/assets/javascripts/notes/components/issue_note_form.vue +++ b/app/assets/javascripts/notes/components/issue_note_form.vue @@ -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 === '') { |