Fix switching of like badge css classes
authorMatthias Schmidt <gravatronics@live.com>
Sun, 25 Sep 2016 10:47:25 +0000 (12:47 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 25 Sep 2016 10:47:28 +0000 (12:47 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Like/Handler.js

index 1083c0f0616b566ed941f4f3f5fe53d3c6630cd3..9c91f4748af5651a97836bc91cc10e5a6c97fed6 100644 (file)
@@ -261,6 +261,9 @@ define(
                        else {
                                elShow(data.badge);
                                
+                               // remove old classes
+                               data.badge.classList.remove('likeCounterLiked', 'likeCounterDisliked');
+                               
                                // update like counter
                                var cumulativeLikes = data.likes - data.dislikes;
                                var content = '<span class="icon icon16 fa-thumbs-o-' + (cumulativeLikes < 0 ? 'down' : 'up' ) + '"></span><span class="wcfLikeValue">';