fixed smile button

This commit is contained in:
nilsding 2014-12-05 21:55:01 +01:00
parent a2e1e2557b
commit 9f1174f56b
1 changed files with 3 additions and 3 deletions

View File

@ -117,7 +117,7 @@ $(document).on "click", "button[name=ab-smile]", ->
aid = btn[0].dataset.aId aid = btn[0].dataset.aId
action = btn[0].dataset.action action = btn[0].dataset.action
count = Number $("span#ab-smile-count-#{aid}").html() count = Number $("span#ab-smile-count-#{aid}").html()
btn[0].dataset.loadingText = "<i class=\"fa fa-meh-o fa-spin\"></i>" btn[0].dataset.loadingText = "<i class=\"fa fa-meh-o fa-spin\"></i> <span id=\"ab-smile-count-#{aid}\">#{count}</span>"
btn.button "loading" btn.button "loading"
target_url = switch action target_url = switch action
@ -149,10 +149,10 @@ $(document).on "click", "button[name=ab-smile]", ->
switch action switch action
when 'smile' when 'smile'
btn[0].dataset.action = 'unsmile' btn[0].dataset.action = 'unsmile'
btn.html "<i class=\"fa fa-frown-o\"></i>" btn.html "<i class=\"fa fa-frown-o\"></i> <span id=\"ab-smile-count-#{aid}\">#{count}</span>"
when 'unsmile' when 'unsmile'
btn[0].dataset.action = 'smile' btn[0].dataset.action = 'smile'
btn.html "<i class=\"fa fa-smile-o\"></i>" btn.html "<i class=\"fa fa-smile-o\"></i> <span id=\"ab-smile-count-#{aid}\">#{count}</span>"
$(document).on "click", "button[name=ab-comments]", -> $(document).on "click", "button[name=ab-comments]", ->
btn = $(this) btn = $(this)