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;
}
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;
$container.find('input.jsClipboardItem').each(function(itemIndex, item) {
var $item = $(item);
- if (!$item.attr('checked')) {
+ if (!$item.prop('checked')) {
$allItemsMarked = false;
}
});
_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) {
var $markedAll = true;
$container.find('input.jsClipboardItem').each(function(index, containerItem) {
var $containerItem = $(containerItem);
- if (!$containerItem.attr('checked')) {
+ if (!$containerItem.prop('checked')) {
$markedAll = false;
}
});
// if markAll object is a checkbox, allow toggling
if ($item.is('input')) {
- $isMarked = $item.attr('checked');
+ $isMarked = $item.prop('checked');
}
// handle item containers
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);
* 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];