Fix disabling of radio buttons
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 2 Jul 2014 16:24:17 +0000 (18:24 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 9 Jul 2014 19:59:00 +0000 (21:59 +0200)
wcfsetup/install/files/js/WCF.Message.js

index 61fcfccd7628aaf942be6f703218608305fd132c..5652fa7c65cf94d488ad39a1e971722546f6dd66 100644 (file)
@@ -135,10 +135,14 @@ WCF.Message.EditHistory = Class.extend({
        _initInputs: function() {
                var self = this;
                this._newIDInputs.change(function(event) {
-                       var newID = $(this).val();
+                       var newID = parseInt($(this).val())
+                       if ($(this).val() === 'current') newID = Infinity;
                        
                        self._oldIDInputs.each(function(event) {
-                               if ($(this).val() >= newID) {
+                               var oldID = parseInt($(this).val())
+                               if ($(this).val() === 'current') oldID = Infinity;
+                               
+                               if (oldID >= newID) {
                                        $(this).disable();
                                }
                                else {
@@ -148,10 +152,14 @@ WCF.Message.EditHistory = Class.extend({
                });
                
                this._oldIDInputs.change(function(event) {
-                       var oldID = $(this).val();
+                       var oldID = parseInt($(this).val());
+                       if ($(this).val() === 'current') oldID = Infinity;
                        
                        self._newIDInputs.each(function(event) {
-                               if ($(this).val() <= oldID) {
+                               var newID = parseInt($(this).val())
+                               if ($(this).val() === 'current') newID = Infinity;
+                               
+                               if (newID <= oldID) {
                                        $(this).disable();
                                }
                                else {