diff options
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/awards_handler.coffee | 16 | ||||
-rw-r--r-- | app/assets/javascripts/notes.js.coffee | 2 |
2 files changed, 11 insertions, 7 deletions
diff --git a/app/assets/javascripts/awards_handler.coffee b/app/assets/javascripts/awards_handler.coffee index 29b11b0cc58..cac9c10332a 100644 --- a/app/assets/javascripts/awards_handler.coffee +++ b/app/assets/javascripts/awards_handler.coffee @@ -5,7 +5,7 @@ class @AwardsHandler @postEmoji emoji, => @addAwardToEmojiBar(emoji) - addAwardToEmojiBar: (emoji) -> + addAwardToEmojiBar: (emoji, custom_path = '') -> if @exist(emoji) if @isActive(emoji) @decrementCounter(emoji) @@ -15,7 +15,7 @@ class @AwardsHandler counter.parent().addClass("active") @addMeToAuthorList(emoji) else - @createEmoji(emoji) + @createEmoji(emoji, custom_path) exist: (emoji) -> @findEmojiIcon(emoji).length > 0 @@ -58,11 +58,11 @@ class @AwardsHandler ), 200 - createEmoji: (emoji) -> + createEmoji: (emoji, custom_path) -> nodes = [] nodes.push("<div class='award active' title='me'>") nodes.push("<div class='icon' data-emoji='" + emoji + "'>") - nodes.push(@getImage(emoji)) + nodes.push(@getImage(emoji, custom_path)) nodes.push("</div>") nodes.push("<div class='counter'>1") nodes.push("</div></div>") @@ -71,8 +71,12 @@ class @AwardsHandler $(".award").tooltip() - getImage: (emoji) -> - $("li[data-emoji='" + emoji + "'").html() + getImage: (emoji, custom_path) -> + if custom_path + $(".awards-menu li").first().html().replace(/emoji\/.*\.png/, custom_path) + else + $("li[data-emoji='" + emoji + "'").html() + postEmoji: (emoji, callback) -> $.post @post_emoji_url, { diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee index 73a95c455e8..7de7632201d 100644 --- a/app/assets/javascripts/notes.js.coffee +++ b/app/assets/javascripts/notes.js.coffee @@ -121,7 +121,7 @@ class @Notes @initTaskList() if note.award - awards_handler.addAwardToEmojiBar(note.note) + awards_handler.addAwardToEmojiBar(note.note, note.emoji_path) ### Check if note does not exists on page |