diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-01-02 20:14:43 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-01-04 23:37:54 +0300 |
commit | 09fc4f557b4967e2c40ec17da07d17b3a637b0d5 (patch) | |
tree | 7dd826beedfaee8cf2e4578866f0fa8ded19704f /app/assets/javascripts/notes.js | |
parent | 9ae7e99a09ad1d9ea570279ce02cd232a55daf28 (diff) |
Review fixes.
Diffstat (limited to 'app/assets/javascripts/notes.js')
-rw-r--r-- | app/assets/javascripts/notes.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 8400d615818..8cdc623c83b 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -494,18 +494,16 @@ if (currentContent === initialContent) { this.removeNoteEditForm($el); - $el.find('.js-md-write-button').trigger('click'); } else { var $buttons = $el.find('.note-form-actions'); - var isWidgetVisible = gl.utils.isInViewport($el[0]); + var isWidgetVisible = gl.utils.isInViewport($el.get(0)); if (!isWidgetVisible) { gl.utils.animateToElement($el); } $el.find('.js-edit-warning').show(); - $el.find('.js-md-write-button').trigger('click'); isAllowed = false; } @@ -553,7 +551,6 @@ var $target = $(e.target); var note = $target.closest('.note'); note.find('.js-edit-warning').hide(); - note.find('.js-md-write-button').trigger('click'); this.revertNoteEditForm($target); return this.removeNoteEditForm(note); }; @@ -566,6 +563,7 @@ $editForm.insertBefore('.notes-form'); $editForm.find('.js-comment-button').enable(); $editForm.find('.js-edit-warning').hide(); + $editForm.find('.js-md-write-button').trigger('click'); }; Notes.prototype.getEditFormSelector = function($el) { @@ -582,6 +580,7 @@ var form = note.find('.current-note-edit-form'); note.removeClass('is-editting'); form.removeClass('current-note-edit-form'); + form.find('.js-edit-warning').hide(); // Replace markdown textarea text with original note text. return form.find('.js-note-text').val(form.find('form.edit-note').data('original-note')); }; @@ -898,8 +897,8 @@ new GLForm($editForm.find('form')); $editForm.find('form').attr('action', postUrl); - $editForm.find('.formTargetId').val(targetId); - $editForm.find('.formTargetType').val(targetType); + $editForm.find('.js-form-target-id').val(targetId); + $editForm.find('.js-form-target-type').val(targetType); $editForm.find('.js-note-text').focus().val(originalContent); } |