diff --git a/app/assets/v2/css/activity_stream.css b/app/assets/v2/css/activity_stream.css
index 80fa298bd19..8bf67cd4ae4 100644
--- a/app/assets/v2/css/activity_stream.css
+++ b/app/assets/v2/css/activity_stream.css
@@ -79,6 +79,13 @@ a .sup {
.action.open {
background-color: #eeeeee;
}
+
+.emoji-container {
+ width: 3.6em;
+ right: 0;
+ top: 0;
+}
+
.comment_container .row{
max-width: 100%;
}
diff --git a/app/assets/v2/js/activity.js b/app/assets/v2/js/activity.js
index 226b92cd0b5..e8d3f7f4360 100644
--- a/app/assets/v2/js/activity.js
+++ b/app/assets/v2/js/activity.js
@@ -740,8 +740,13 @@ $(document).ready(function() {
-
+
@@ -754,6 +759,24 @@ $(document).ready(function() {
});
};
+ // add emoji to comment
+ let activityCommentTextArea = '';
+ var picker = new EmojiButton({
+ position: 'right-end'
+ });
+
+ picker.on('emoji', function(emoji) {
+ activityCommentTextArea.value += ` ${emoji} `;
+ });
+
+ $(document).on('click', '.emoji_button', function(e) {
+ e.preventDefault();
+ const commentArea = $(this).parents('.comment-area')[0];
+ const emojiContainer = $(this).parents('.emoji-container')[0];
+
+ picker.pickerVisible ? picker.hidePicker() : picker.showPicker(emojiContainer);
+ activityCommentTextArea = commentArea.children[0];
+ });
// post comment activity
$(document).on('click', '.comment_container .action.like', function(e) {