From 1a50aae0fde152230aac9a8c25a5ac594e4c1172 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 30 Apr 2013 00:10:13 +0200 Subject: [PATCH] Fixed check for checkbox attribute "checked" --- wcfsetup/install/files/acp/js/WCF.ACP.js | 6 +++--- wcfsetup/install/files/js/WCF.js | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index a53d5d9cf3..062f76f328 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -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; diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 3f334bc270..40737f1049 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -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]; -- 2.20.1