• Clicking Like updates the number of likes, and makes the button un-clickable a second time, but does not update the class list to visually indicate that, until the page is reloaded. (I use “.cld-prevent .fa-thumbs-up” to style unclickable ones differently.) This fixes it:

    --- a/blog/wp-content/plugins/comments-like-dislike/js/cld-frontend.js
    +++ b/blog/wp-content/plugins/comments-like-dislike/js/cld-frontend.js
    @@ -50,6 +50,7 @@ jQuery(document).ready(function ($) {
                             if (res.success) {
                                 var latest_count = res.latest_count;
                                 selector.closest('.cld-common-wrap').find('.cld-count-wrap').html(latest_count);
    +                            selector.closest('.cld-like-dislike-wrap').find('.cld-like-dislike-trigger').addClass('cld-prevent');
                                 if (restriction_type != 'no') {
                                     selector.closest('.cld-like-dislike-wrap').find('.cld-like-dislike-trigger').data('already-liked', 1);
                                 }
  • The topic ‘Clicking Like should also add the “cld-prevent” class’ is closed to new replies.