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 | |
parent | 9ae7e99a09ad1d9ea570279ce02cd232a55daf28 (diff) | |
download | gitlab-ce-09fc4f557b4967e2c40ec17da07d17b3a637b0d5.tar.gz |
Review fixes.
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/gl_form.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/lib/utils/common_utils.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/notes.js | 11 |
3 files changed, 8 insertions, 9 deletions
diff --git a/app/assets/javascripts/gl_form.js b/app/assets/javascripts/gl_form.js index 7dc2d13e5d8..04814fa0843 100644 --- a/app/assets/javascripts/gl_form.js +++ b/app/assets/javascripts/gl_form.js @@ -35,8 +35,8 @@ autosize(this.textarea); // form and textarea event listeners this.addEventListeners(); - gl.text.init(this.form); } + gl.text.init(this.form); // hide discard button this.form.find('.js-note-discard').hide(); return this.form.show(); diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js index 7bf62cfd927..54f2e7ad7d7 100644 --- a/app/assets/javascripts/lib/utils/common_utils.js +++ b/app/assets/javascripts/lib/utils/common_utils.js @@ -131,11 +131,11 @@ gl.utils.animateToElement = function($el) { var top = $el.offset().top; gl.navBarHeight = gl.navBarHeight || $('.navbar-gitlab').height(); - gl.navLinksHieght = gl.navLinksHieght || $('.nav-links').height(); + gl.navLinksHeight = gl.navLinksHeight || $('.nav-links').height(); gl.mrTabsHeight = gl.mrTabsHeight || $('.merge-request-tabs').height(); return $('body, html').animate({ - scrollTop: top - (gl.navBarHeight + gl.navLinksHieght + gl.mrTabsHeight) + scrollTop: top - (gl.navBarHeight + gl.navLinksHeight + gl.mrTabsHeight) }, 200); }; 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); } |