You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2018/12/12 16:32:26 UTC

[5/5] allura git commit: [#8263] Add styles for current reaction indication

[#8263] Add styles for current reaction indication


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/e9ca8128
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/e9ca8128
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/e9ca8128

Branch: refs/heads/master
Commit: e9ca812838a8f13dbd77528c6d1168e672249c67
Parents: 2d72026
Author: Shalitha Suranga <sh...@gmail.com>
Authored: Wed Nov 28 09:50:18 2018 +0530
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Dec 12 16:32:04 2018 +0000

----------------------------------------------------------------------
 Allura/allura/lib/widgets/resources/js/reactions.js | 15 ++++++++++++---
 Allura/allura/nf/allura/css/site_style.css          | 13 ++++++++++++-
 2 files changed, 24 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/e9ca8128/Allura/allura/lib/widgets/resources/js/reactions.js
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/resources/js/reactions.js b/Allura/allura/lib/widgets/resources/js/reactions.js
index 1f9d1c2..dc880a6 100644
--- a/Allura/allura/lib/widgets/resources/js/reactions.js
+++ b/Allura/allura/lib/widgets/resources/js/reactions.js
@@ -33,7 +33,16 @@ $('.reaction-button').tooltipster({
     interactive: true,
     functionReady: function(instance, helper) {
         $(helper).find('.emoji_button').click(function() {
-            reactComment(instance, $(this).data('emoji'));
+            var r = $(this).data('emoji');
+            if($(this).hasClass('current')) {
+                $(this).removeClass('current');
+                $(instance).data('currentreact', '');
+            }
+            else {
+                $(this).addClass('current');
+                $(instance).data('currentreact', r);
+            }
+            reactComment(instance, r);
         });
     }
 });
@@ -45,8 +54,8 @@ $('.reaction-button').each(function() {
         var currentemoji = $(this).data('currentreact');
         var emohtml = '';
         for(var emo in global_reactions) {
-            emohtml += '<span class=\'emoji_button' + (currentemoji == emo ? ' current' : '') +  '\' data-emoji=\'' + emo + '\'>' + 
-            twemoji.parse(global_reactions[emo]) + '</span>';
+            emohtml += '<div class=\'emoji_button' + (currentemoji == emo ? ' current' : '') +  '\' data-emoji=\'' + emo + '\'>' + 
+            twemoji.parse(global_reactions[emo]) + '</div>';
         }
         var tooltiptext = '<div class="post-reactions-list">' + emohtml + '</div>';
         $(this).tooltipster('content', tooltiptext);

http://git-wip-us.apache.org/repos/asf/allura/blob/e9ca8128/Allura/allura/nf/allura/css/site_style.css
----------------------------------------------------------------------
diff --git a/Allura/allura/nf/allura/css/site_style.css b/Allura/allura/nf/allura/css/site_style.css
index af187a9..aed30d8 100644
--- a/Allura/allura/nf/allura/css/site_style.css
+++ b/Allura/allura/nf/allura/css/site_style.css
@@ -3810,9 +3810,20 @@ fieldset.preferences legend {
     width: 100%;
 }
 
+.post-reactions-list .emoji_button {
+    padding: 1px 2px 1px 2px;
+    margin-left: 2px;
+    display: inline-block;
+}
+
+.post-reactions-list .current {
+    border: #999 solid 1px;
+    border-radius: 2px 2px;
+}
+
 .post-reactions-list img.emoji { 
     width: 16px;
-    margin-left: 4px;
+    margin: 2px 0px -2px 1px;
     cursor: pointer;
 }