Skip to content

Commit

Permalink
Fixes 232 Emojist only show once per line, fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
camsong committed Apr 8, 2013
1 parent 7ef6d56 commit 5baebf8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 4 additions & 3 deletions app/assets/javascripts/backbone/plugins/emoticons.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -909,10 +909,11 @@ class Kandan.Plugins.Emoticons
Kandan.Modifiers.register @options.regex, (message, activity) =>
matches = message.match(@options.regex)
for match in _.unique(matches)
match = match.trim();
match = match.trim()
emoticon = @emoticons[match]

if emoticon
message = message.replace(match, @options.template(emoticon))
# replace all matches
message = message.split(match).join(@options.template(emoticon))

return message
10 changes: 5 additions & 5 deletions app/assets/javascripts/layout.js.coffee
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
$(document).ready ->
$(".user_menu_link").click (e)->
e.preventDefault()
$(".user_menu").toggle()
false
e.preventDefault()
$(".user_menu").toggle()
false

$(".user_menu a").click (e)->
$(".user_menu").toggle()
$(".user_menu a").click (e)->
$(".user_menu").toggle()

0 comments on commit 5baebf8

Please sign in to comment.