diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/droplab/drop_down.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/notes.js | 2 | ||||
-rw-r--r-- | app/views/projects/notes/_comment_button.html.haml | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/droplab/drop_down.js b/app/assets/javascripts/droplab/drop_down.js index f522859c457..9588921ebcd 100644 --- a/app/assets/javascripts/droplab/drop_down.js +++ b/app/assets/javascripts/droplab/drop_down.js @@ -37,7 +37,7 @@ Object.assign(DropDown.prototype, { clickEvent: function(e) { if (e.target.tagName === 'UL') return; - var selected = utils.closest(e.target, 'LI', ''); + var selected = utils.closest(e.target, 'LI'); if (!selected) return; this.addSelectedClass(selected); diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 66e89b7607a..9dd516d93fd 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -143,7 +143,7 @@ require('./task_list'); form.querySelector('.js-comment-type-dropdown .dropdown-menu'), form.querySelector('#note_type'), form.querySelector('.js-comment-type-dropdown .js-comment-submit-button'), - form.querySelector('.js-note-target-close'), + form.querySelector('.js-note-target-close:not(.hidden)') || form.querySelector('.js-note-target-reopen'), ); this.commentTypeToggle.initDroplab(); diff --git a/app/views/projects/notes/_comment_button.html.haml b/app/views/projects/notes/_comment_button.html.haml index 008363263b3..2e65a3bf294 100644 --- a/app/views/projects/notes/_comment_button.html.haml +++ b/app/views/projects/notes/_comment_button.html.haml @@ -1,4 +1,5 @@ - noteable_name = @note.noteable.human_class_name +- noteable_state_action = noteable_name =~ /(merge request|issue)/ && @note.noteable['state'] == 'closed' ? 'reopen' : 'close' .pull-left.btn-group.append-right-10.comment-type-dropdown.js-comment-type-dropdown %input.btn.btn-nr.btn-create.comment-btn.js-comment-button.js-comment-submit-button{ type: 'submit', value: 'Comment' } @@ -8,7 +9,7 @@ = icon('caret-down') %ul#resolvable-comment-menu.dropdown-menu{ data: { dropdown: true } } - %li#comment.droplab-item-selected{ data: { value: '', 'button-text' => 'Comment', 'secondary-button-text' => "Comment & close #{noteable_name}" } } + %li#comment.droplab-item-selected{ data: { value: '', 'button-text' => 'Comment', 'secondary-button-text' => "Comment & #{noteable_state_action} #{noteable_name}" } } = icon('check') .description %strong Comment @@ -17,7 +18,7 @@ %li.divider - %li#discussion{ data: { value: 'DiscussionNote', 'button-text' => 'Start discussion', 'secondary-button-text' => "Start discussion & close #{noteable_name}" } } + %li#discussion{ data: { value: 'DiscussionNote', 'button-text' => 'Start discussion', 'secondary-button-text' => "Start discussion & #{noteable_state_action} #{noteable_name}" } } = icon('check') .description %strong Start discussion |