Fixed check for checkbox attribute "checked"
authorAlexander Ebert <ebert@woltlab.com>
Mon, 29 Apr 2013 22:10:13 +0000 (00:10 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 29 Apr 2013 22:10:13 +0000 (00:10 +0200)
wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/js/WCF.js

index a53d5d9cf355cb2b4314b531e934b2979ccde776..062f76f328db5e2ba395ac63072edbf64a9439db 100644 (file)
@@ -490,7 +490,7 @@ WCF.ACP.Package.Installation = Class.extend({
                        var $inputElement = $(inputElement);
                        var $type = $inputElement.attr('type');
                        
-                       if (($type == 'checkbox' || $type == 'radio') && !$inputElement.attr('checked')) {
+                       if (($type == 'checkbox' || $type == 'radio') && !$inputElement.prop('checked')) {
                                return false;
                        }
                        
@@ -1204,11 +1204,11 @@ WCF.ACP.Options = Class.extend({
                        case 'input':
                                switch(option.attr('type')) {
                                        case 'checkbox':
-                                               this._execute(option.attr('checked'), $disableOptions, $enableOptions);
+                                               this._execute(option.prop('checked'), $disableOptions, $enableOptions);
                                        break;
                                        
                                        case 'radio':
-                                               if (option.attr('checked')) {
+                                               if (option.prop('checked')) {
                                                        this._execute(true, $disableOptions, $enableOptions);
                                                }
                                        break;
index 3f334bc270f57792713f4b0584e1a734875cd469..40737f1049c46724e4acd86a1f0634ab57bdd70c 100755 (executable)
@@ -969,7 +969,7 @@ WCF.Clipboard = {
                                        
                                        $container.find('input.jsClipboardItem').each(function(itemIndex, item) {
                                                var $item = $(item);
-                                               if (!$item.attr('checked')) {
+                                               if (!$item.prop('checked')) {
                                                        $allItemsMarked = false;
                                                }
                                        });
@@ -1040,7 +1040,7 @@ WCF.Clipboard = {
        _click: function(event) {
                var $item = $(event.target);
                var $objectID = $item.data('objectID');
-               var $isMarked = ($item.attr('checked')) ? true : false;
+               var $isMarked = ($item.prop('checked')) ? true : false;
                var $objectIDs = [ $objectID ];
                
                if ($isMarked) {
@@ -1061,7 +1061,7 @@ WCF.Clipboard = {
                        var $markedAll = true;
                        $container.find('input.jsClipboardItem').each(function(index, containerItem) {
                                var $containerItem = $(containerItem);
-                               if (!$containerItem.attr('checked')) {
+                               if (!$containerItem.prop('checked')) {
                                        $markedAll = false;
                                }
                        });
@@ -1096,7 +1096,7 @@ WCF.Clipboard = {
                
                // if markAll object is a checkbox, allow toggling
                if ($item.is('input')) {
-                       $isMarked = $item.attr('checked');
+                       $isMarked = $item.prop('checked');
                }
                
                // handle item containers
@@ -1109,14 +1109,14 @@ WCF.Clipboard = {
                                var $containerItem = $(containerItem);
                                var $objectID = $containerItem.data('objectID');
                                if ($isMarked) {
-                                       if (!$containerItem.attr('checked')) {
+                                       if (!$containerItem.prop('checked')) {
                                                $containerItem.attr('checked', 'checked');
                                                this._markedObjectIDs.push($objectID);
                                                $objectIDs.push($objectID);
                                        }
                                }
                                else {
-                                       if ($containerItem.attr('checked')) {
+                                       if ($containerItem.prop('checked')) {
                                                $containerItem.removeAttr('checked');
                                                this._markedObjectIDs = $.removeArrayValue(this._markedObjectIDs, $objectID);
                                                $objectIDs.push($objectID);
@@ -3646,7 +3646,7 @@ WCF.ToggleOptions = Class.extend({
         * Toggles items.
         */
        _toggle: function() {
-               if (!this._element.attr('checked')) return;
+               if (!this._element.prop('checked')) return;
                
                for (var $i = 0, $length = this._showItems.length; $i < $length; $i++) {
                        var $item = this._showItems[$i];