javascripts: "fix" (un)smile update bug

This commit is contained in:
Georg Gadinger 2020-04-18 23:44:59 +02:00
parent 3a726b83c3
commit b926820d90
2 changed files with 20 additions and 16 deletions

View File

@ -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

View File

@ -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