diff options
author | Kushal Pandya <kushalspandya@gmail.com> | 2017-05-18 18:05:01 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-05-18 18:05:01 +0000 |
commit | 4b9c952d358b55aecd19fa3c3c6cedc91d823bba (patch) | |
tree | d8367e578fc2837533ad816ee911f20dc3cacf99 /app/assets/javascripts/notes.js | |
parent | 6ca5a9890c2a6761c932a6da4e82505db4b756f5 (diff) | |
download | gitlab-ce-4b9c952d358b55aecd19fa3c3c6cedc91d823bba.tar.gz |
Fix ability to edit diff notes multiple times
Diffstat (limited to 'app/assets/javascripts/notes.js')
-rw-r--r-- | app/assets/javascripts/notes.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 67df1c0c4d7..62a46733cc4 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -578,12 +578,12 @@ const normalizeNewlines = function(str) { Updates the current note field. */ - Notes.prototype.updateNote = function(_xhr, noteEntity, _status) { + Notes.prototype.updateNote = function(noteEntity, $targetNote) { var $noteEntityEl, $note_li; // Convert returned HTML to a jQuery object so we can modify it further $noteEntityEl = $(noteEntity.html); $noteEntityEl.addClass('fade-in-full'); - this.revertNoteEditForm(); + this.revertNoteEditForm($targetNote); gl.utils.localTimeAgo($('.js-timeago', $noteEntityEl)); $noteEntityEl.renderGFM(); $noteEntityEl.find('.js-task-list-container').taskList('enable'); @@ -1404,7 +1404,7 @@ const normalizeNewlines = function(str) { gl.utils.ajaxPost(formAction, formData) .then((note) => { // Submission successful! render final note element - this.updateNote(null, note, null); + this.updateNote(note, $editingNote); }) .fail(() => { // Submission failed, revert back to original note |