mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-30 14:12:13 +02:00
javascripts: "fix" (un)smile update bug
This commit is contained in:
parent
3a726b83c3
commit
b926820d90
2 changed files with 20 additions and 16 deletions
app/assets/javascripts/answerbox
|
@ -31,6 +31,7 @@ $(document).on "click", "button[name=ab-smile-comment]", ->
|
||||||
showNotification translate('frontend.error.message'), false
|
showNotification translate('frontend.error.message'), false
|
||||||
complete: (jqxhr, status) ->
|
complete: (jqxhr, status) ->
|
||||||
btn.button "reset"
|
btn.button "reset"
|
||||||
|
window.setTimeout ->
|
||||||
if success
|
if success
|
||||||
switch action
|
switch action
|
||||||
when 'smile'
|
when 'smile'
|
||||||
|
@ -39,3 +40,4 @@ $(document).on "click", "button[name=ab-smile-comment]", ->
|
||||||
when 'unsmile'
|
when 'unsmile'
|
||||||
btn[0].dataset.action = 'smile'
|
btn[0].dataset.action = 'smile'
|
||||||
btn.html "<i class=\"fa fa-smile-o\"></i> <span id=\"ab-comment-smile-count-#{cid}\">#{count}</span>"
|
btn.html "<i class=\"fa fa-smile-o\"></i> <span id=\"ab-comment-smile-count-#{cid}\">#{count}</span>"
|
||||||
|
, 20
|
||||||
|
|
|
@ -31,6 +31,7 @@ $(document).on "click", "button[name=ab-smile]", ->
|
||||||
showNotification translate('frontend.error.message'), false
|
showNotification translate('frontend.error.message'), false
|
||||||
complete: (jqxhr, status) ->
|
complete: (jqxhr, status) ->
|
||||||
btn.button "reset"
|
btn.button "reset"
|
||||||
|
window.setTimeout ->
|
||||||
if success
|
if success
|
||||||
switch action
|
switch action
|
||||||
when 'smile'
|
when 'smile'
|
||||||
|
@ -39,3 +40,4 @@ $(document).on "click", "button[name=ab-smile]", ->
|
||||||
when 'unsmile'
|
when 'unsmile'
|
||||||
btn[0].dataset.action = 'smile'
|
btn[0].dataset.action = 'smile'
|
||||||
btn.html "<i class=\"fa fa-smile-o\"></i> <span id=\"ab-smile-count-#{aid}\">#{count}</span>"
|
btn.html "<i class=\"fa fa-smile-o\"></i> <span id=\"ab-smile-count-#{aid}\">#{count}</span>"
|
||||||
|
, 20
|
||||||
|
|
Loading…
Reference in a new issue