Fix rating form field's JavaScript for more than 9 rating levels
authorMatthias Schmidt <gravatronics@live.com>
Fri, 19 Apr 2019 12:45:14 +0000 (14:45 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 19 Apr 2019 12:45:14 +0000 (14:45 +0200)
See #2509

wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Field/Controller/Rating.js

index 2edc46caf04a2c5df3e880c6a8801f1a55b6d530..2d6a992a68a65994f6a3ba7f43a4b1a5db8b59aa 100644 (file)
@@ -85,7 +85,7 @@ define(['Dictionary', 'Environment'], function(Dictionary, Environment) {
                        this._ratingElements.forEach(function(ratingElement, rating) {
                                var icon = elByClass('icon', ratingElement)[0];
                                
-                               this._toggleIcon(icon, rating <= currentRating);
+                               this._toggleIcon(icon, ~~rating <= ~~currentRating);
                        }.bind(this));
                },
                
@@ -121,7 +121,7 @@ define(['Dictionary', 'Environment'], function(Dictionary, Environment) {
                        this._ratingElements.forEach(function(ratingElement, rating) {
                                var icon = elByClass('icon', ratingElement)[0];
                                
-                               this._toggleIcon(icon, rating <= this._input.value);
+                               this._toggleIcon(icon, ~~rating <= ~~this._input.value);
                        }.bind(this));
                },