Fix reaction sorting function
authorJoshua Rüsweg <ruesweg@woltlab.com>
Fri, 24 May 2019 14:06:01 +0000 (16:06 +0200)
committerJoshua Rüsweg <ruesweg@woltlab.com>
Fri, 24 May 2019 14:06:01 +0000 (16:06 +0200)
See #2508

wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Reaction/Handler.js

index f498d2454632a3867ad9feaaae693734f7329c18..73006a2edec842f329f6ac1599806b04babe7a0a 100644 (file)
@@ -330,12 +330,7 @@ define(
                                
                                // sort the array
                                sortedReactionTypes.sort(function (a, b) {
-                                       if (a.showOrder > b.showOrder) {
-                                               return 1;
-                                       }
-                                       else {
-                                               return -1;
-                                       }
+                                       return a.showOrder - b.showOrder;
                                });
                                
                                return sortedReactionTypes;