Commit e3d84498 authored by Phil Hughes's avatar Phil Hughes

Moved SCSS values into variables

parent a7e76a61
class @AwardsHandler class @AwardsHandler
constructor: (@post_emoji_url, @noteable_type, @noteable_id, @aliases) -> constructor: (@post_emoji_url, @noteable_type, @noteable_id, @aliases) ->
$(".js-add-award").click (event) => $(".js-add-award").on "click", (event) =>
event.stopPropagation() event.stopPropagation()
event.preventDefault() event.preventDefault()
...@@ -18,7 +18,9 @@ class @AwardsHandler ...@@ -18,7 +18,9 @@ class @AwardsHandler
handleClick: (e) -> handleClick: (e) ->
e.preventDefault() e.preventDefault()
emoji = $(this).find(".icon").data "emoji" emoji = $(this)
.find(".icon")
.data "emoji"
awards_handler.addAward emoji awards_handler.addAward emoji
showEmojiMenu: -> showEmojiMenu: ->
...@@ -80,9 +82,13 @@ class @AwardsHandler ...@@ -80,9 +82,13 @@ class @AwardsHandler
removeMeFromAuthorList: (emoji) -> removeMeFromAuthorList: (emoji) ->
award_block = @findEmojiIcon(emoji).parent() award_block = @findEmojiIcon(emoji).parent()
authors = award_block.attr("data-original-title").split(", ") authors = award_block
.attr("data-original-title")
.split(", ")
authors.splice(authors.indexOf("me"),1) authors.splice(authors.indexOf("me"),1)
award_block.closest(".js-emoji-btn").attr("data-original-title", authors.join(", ")) award_block
.closest(".js-emoji-btn")
.attr("data-original-title", authors.join(", "))
@resetTooltip(award_block) @resetTooltip(award_block)
addMeToAuthorList: (emoji) -> addMeToAuthorList: (emoji) ->
......
...@@ -150,3 +150,14 @@ $dropdown-toggle-border-color: #EAEAEA; ...@@ -150,3 +150,14 @@ $dropdown-toggle-border-color: #EAEAEA;
$dropdown-toggle-hover-border-color: darken($dropdown-toggle-border-color, 15%); $dropdown-toggle-hover-border-color: darken($dropdown-toggle-border-color, 15%);
$dropdown-toggle-icon-color: #C4C4C4; $dropdown-toggle-icon-color: #C4C4C4;
$dropdown-toggle-hover-icon-color: $dropdown-toggle-hover-border-color; $dropdown-toggle-hover-icon-color: $dropdown-toggle-hover-border-color;
/*
* Award emoji
*/
$award-emoji-menu-bg: #FFF;
$award-emoji-menu-border: #F1F2F4;
$award-emoji-menu-radius: 3px;
$award-emoji-menu-btn-radius: 4px;
$award-emoji-menu-btn-hover-bg: #EDEDED;
$award-emoji-control-active-bg: $award-emoji-menu-btn-hover-bg;
$award-emoji-new-btn-color: #DCDCDC;
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
display: none; display: none;
min-width: 160px; min-width: 160px;
font-size: 14px; font-size: 14px;
background-color: #fff; background-color: $award-emoji-menu-bg;
border: 1px solid #F1F2F4; border: 1px solid $award-emoji-menu-border;
border-radius: 2px; border-radius: $award-emoji-menu-radius;
box-shadow: 0 6px 12px rgba(0,0,0,.175); box-shadow: 0 6px 12px rgba(0,0,0,.175);
.emoji-menu-content { .emoji-menu-content {
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
padding: 0; padding: 0;
background: none; background: none;
border: 0; border: 0;
border-radius: 4px; border-radius: $award-emoji-menu-btn-radius;
&:hover { &:hover {
background-color: #ededed; background-color: $award-emoji-menu-btn-hover-bg;
} }
.emoji-icon { .emoji-icon {
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
&.active, &.active,
&:active { &:active {
background-color: #ededed; background-color: $award-emoji-control-active-bg;
box-shadow: none; box-shadow: none;
outline: 0; outline: 0;
} }
...@@ -107,6 +107,6 @@ ...@@ -107,6 +107,6 @@
} }
.award-control-icon { .award-control-icon {
color: #DCDCDC; color: $award-emoji-new-btn-color;
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment