Skip to content
Snippets Groups Projects
Commit ba925fb0 authored by Aurélien Warnon's avatar Aurélien Warnon
Browse files

[FIX] website_slides: fix UI glitch when adding like/dislike to slide

Task #1923443

Purpose
=======

When adding a like/dislike to a slide, the like/dislike counter was not properly updated.

partly closes #29901

closes odoo/odoo#30027
parent 46f6a26a
No related branches found
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@ var page_widgets = {};
if(is_public){
this.popover_alert(button, _.str.sprintf(_t('Please <a href="/web?redirect=%s">login</a> to vote this slide'), (document.URL)));
}else{
var target = button.find('.fa');
var target = button.find('.o_wslides_like_dislike_count');
if (local_storage.getItem('slide_vote_' + slide_id) !== user_id.toString()) {
ajax.jsonRpc(href, 'call', {slide_id: slide_id}).then(function (data) {
target.text(data);
......
......@@ -462,7 +462,7 @@
tabindex="0"
data-toggle="popover">
<i class="fa fa-thumbs-up fa-1x" role="img" aria-label="Likes" title="Likes"/>
<t t-esc="slide.likes"/>
<span class="o_wslides_like_dislike_count" t-esc="slide.likes"/>
</span>
<span
class="oe_slide_js_unlike"
......@@ -473,7 +473,7 @@
tabindex="0"
data-toggle="popover">
<i class="fa fa-thumbs-down fa-1x" role="img" aria-label="Dislikes" title="Dislikes"/>
<t t-esc="slide.dislikes"/>
<span class="o_wslides_like_dislike_count" t-esc="slide.dislikes"/>
</span>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment