summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2017-01-05 00:44:00 +0300
committerFatih Acet <acetfatih@gmail.com>2017-01-05 00:44:00 +0300
commit36412ee2c23015927fd7980df4997ec46c0b81c3 (patch)
tree3af0188d36a2dfe587b5ba83fe70e677f0c14dfb
parente3d92a6cb4ee9cfa2e5283a3b9d2d91be3a232fa (diff)
downloadgitlab-ce-single-edit-comment-widget-2.tar.gz
Fix review comments.single-edit-comment-widget-2
-rw-r--r--app/assets/javascripts/lib/utils/common_utils.js2
-rw-r--r--app/assets/javascripts/notes.js5
-rw-r--r--app/views/projects/notes/_edit_form.html.haml2
-rw-r--r--app/views/projects/notes/_note.html.haml2
4 files changed, 6 insertions, 5 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js
index 54f2e7ad7d7..31a71379af3 100644
--- a/app/assets/javascripts/lib/utils/common_utils.js
+++ b/app/assets/javascripts/lib/utils/common_utils.js
@@ -128,7 +128,7 @@
return e.metaKey || e.ctrlKey || e.altKey || e.shiftKey;
};
- gl.utils.animateToElement = function($el) {
+ gl.utils.scrollToElement = function($el) {
var top = $el.offset().top;
gl.navBarHeight = gl.navBarHeight || $('.navbar-gitlab').height();
gl.navLinksHeight = gl.navLinksHeight || $('.nav-links').height();
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js
index 8cdc623c83b..8de5a6191b6 100644
--- a/app/assets/javascripts/notes.js
+++ b/app/assets/javascripts/notes.js
@@ -500,7 +500,7 @@
var isWidgetVisible = gl.utils.isInViewport($el.get(0));
if (!isWidgetVisible) {
- gl.utils.animateToElement($el);
+ gl.utils.scrollToElement($el);
}
$el.find('.js-edit-warning').show();
@@ -563,7 +563,6 @@
$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) {
@@ -900,6 +899,8 @@
$editForm.find('.js-form-target-id').val(targetId);
$editForm.find('.js-form-target-type').val(targetType);
$editForm.find('.js-note-text').focus().val(originalContent);
+ $editForm.find('.js-md-write-button').trigger('click');
+ $editForm.find('.referenced-users').hide();
}
Notes.prototype.updateTaskList = function(e) {
diff --git a/app/views/projects/notes/_edit_form.html.haml b/app/views/projects/notes/_edit_form.html.haml
index 38fe0f039cd..d36b4e6c8ab 100644
--- a/app/views/projects/notes/_edit_form.html.haml
+++ b/app/views/projects/notes/_edit_form.html.haml
@@ -3,7 +3,7 @@
= hidden_field_tag :authenticity_token, form_authenticity_token
= hidden_field_tag :target_id, '', class: 'js-form-target-id'
= hidden_field_tag :target_type, '', class: 'js-form-target-type'
- = render layout: 'projects/md_preview', locals: { preview_class: 'md-preview' } do
+ = render layout: 'projects/md_preview', locals: { preview_class: 'md-preview', referenced_users: true } do
= render 'projects/zen', attr: 'note[note]', classes: 'note-textarea js-note-text js-task-list-field', placeholder: "Write a comment or drag your files here..."
= render 'projects/notes/hints'
diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml
index 3c62c94eafc..36c388c3318 100644
--- a/app/views/projects/notes/_note.html.haml
+++ b/app/views/projects/notes/_note.html.haml
@@ -67,7 +67,7 @@
= note.redacted_note_html
= edited_time_ago_with_tooltip(note, placement: 'bottom', html_class: 'note_edited_ago', include_author: true)
- if note_editable
- .original-note-content.hidden{data: {post_url: namespace_project_note_path(@project.namespace, @project, note), target_id: note.noteable.id, target_type: note.noteable.class.name.underscore}}
+ .original-note-content.hidden{ data: { post_url: namespace_project_note_path(@project.namespace, @project, note), target_id: note.noteable.id, target_type: note.noteable.class.name.underscore } }
#{note.note}
%textarea.hidden.js-task-list-field.original-task-list #{note.note}
.note-awards