summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2016-05-26 12:15:20 +0300
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-06-06 11:03:39 +0200
commiteaff5afc9b50f41aceae32282e92f6450062a074 (patch)
treeba80cfdedf0c4f0bb345145e2d7c652c10b1aa7f
parent2f9c2149a38e8a4067cb50c1cd1bbb1e72c263b3 (diff)
downloadgitlab-ce-eaff5afc9b50f41aceae32282e92f6450062a074.tar.gz
Show emoji menu in notes.
-rw-r--r--app/assets/javascripts/awards_handler.coffee9
-rw-r--r--app/assets/stylesheets/pages/notes.scss16
-rw-r--r--app/views/projects/notes/_note.html.haml3
3 files changed, 25 insertions, 3 deletions
diff --git a/app/assets/javascripts/awards_handler.coffee b/app/assets/javascripts/awards_handler.coffee
index 766c653111a..e211c86f425 100644
--- a/app/assets/javascripts/awards_handler.coffee
+++ b/app/assets/javascripts/awards_handler.coffee
@@ -51,7 +51,7 @@ class @AwardsHandler
$('#emoji_search').focus()
else
$addBtn.addClass 'is-loading is-active'
- url = $addBtn.data 'award-menu-url'
+ url = @getAwardMenuUrl()
@createEmojiMenu url, =>
$addBtn.removeClass 'is-loading'
@@ -74,6 +74,7 @@ class @AwardsHandler
positionMenu: ($menu, $addBtn) ->
+
position = $addBtn.data('position')
# The menu could potentially be off-screen or in a hidden overflow element
@@ -240,8 +241,10 @@ class @AwardsHandler
return @createEmoji_ emoji if $('.emoji-menu').length
- awardMenuUrl = gl.awardMenuUrl or '/emojis'
- @createEmojiMenu awardMenuUrl, => @createEmoji emoji
+ @createEmojiMenu @getAwardMenuUrl(), => @createEmoji emoji
+
+
+ getAwardMenuUrl: -> return gl.awardMenuUrl or '/emojis'
resolveNameToCssClass: (emoji) ->
diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss
index a3e1ac13a43..3acc9152c01 100644
--- a/app/assets/stylesheets/pages/notes.scss
+++ b/app/assets/stylesheets/pages/notes.scss
@@ -120,6 +120,22 @@ ul.notes {
padding-bottom: 3px;
}
+ .note-emoji-button {
+ .fa-spinner {
+ display: none;
+ }
+
+ &.is-loading {
+ .fa-smile-o {
+ display: none;
+ }
+
+ .fa-spinner {
+ display: inline-block;
+ }
+ }
+ }
+
}
}
diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml
index f1045bbd8c3..c176778c515 100644
--- a/app/views/projects/notes/_note.html.haml
+++ b/app/views/projects/notes/_note.html.haml
@@ -22,6 +22,9 @@
%span.note-role
= access
- if note_editable
+ = link_to '#', title: 'Add Reaction', class: 'note-emoji-button js-add-award js-note-emoji', data: { position: 'right' } do
+ = icon('spinner spin')
+ = icon('smile-o')
= link_to '#', title: 'Edit comment', class: 'note-action-button js-note-edit' do
= icon('pencil')
= link_to namespace_project_note_path(note.project.namespace, note.project, note), title: 'Remove comment', method: :delete, data: { confirm: 'Are you sure you want to remove this comment?' }, remote: true, class: 'note-action-button js-note-delete danger' do