Skip to content

Commit 9d399bd

Browse files
committed
Fix #451
Now using prop where appropriate to set properties.
1 parent 24ac202 commit 9d399bd

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/jquery.multiselect.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
var button = (this.button = $('<button type="button"><span class="ui-icon ui-icon-triangle-1-s"></span></button>'))
6161
.addClass('ui-multiselect ui-widget ui-state-default ui-corner-all')
6262
.addClass(o.classes)
63-
.attr({ 'title':el.attr('title'), 'aria-haspopup':true, 'tabIndex':el.attr('tabIndex') })
63+
.attr({ 'title':el.attr('title'), 'tabIndex':el.attr('tabIndex') })
64+
.prop('aria-haspopup', true)
6465
.insertAfter(el),
6566

6667
buttonlabel = (this.buttonlabel = $('<span />'))
@@ -251,7 +252,7 @@
251252
return value;
252253
},
253254

254-
// this exists as a separate method so that the developer
255+
// this exists as a separate method so that the developer
255256
// can easily override it.
256257
_setButtonValue: function(value) {
257258
this.buttonlabel.text(value);
@@ -388,7 +389,7 @@
388389
$this.focus();
389390

390391
// toggle aria state
391-
$this.attr('aria-selected', checked);
392+
$this.prop('aria-selected', checked);
392393

393394
// change state on the original option tags
394395
tags.each(function() {
@@ -534,7 +535,7 @@
534535
},
535536

536537
_toggleDisabled: function(flag) {
537-
this.button.attr({ 'disabled':flag, 'aria-disabled':flag })[ flag ? 'addClass' : 'removeClass' ]('ui-state-disabled');
538+
this.button.prop({ 'disabled':flag, 'aria-disabled':flag })[ flag ? 'addClass' : 'removeClass' ]('ui-state-disabled');
538539

539540
var inputs = this.menu.find('input');
540541
var key = "ech-multiselect-disabled";
@@ -550,10 +551,10 @@
550551
}
551552

552553
inputs
553-
.attr({ 'disabled':flag, 'arial-disabled':flag })
554+
.prop({ 'disabled':flag, 'arial-disabled':flag })
554555
.parent()[ flag ? 'addClass' : 'removeClass' ]('ui-state-disabled');
555556

556-
this.element.attr({
557+
this.element.prop({
557558
'disabled':flag,
558559
'aria-disabled':flag
559560
});
@@ -655,9 +656,9 @@
655656
getChecked: function() {
656657
return this.menu.find('input').filter(':checked');
657658
},
658-
659+
659660
getUnchecked: function() {
660-
return this.menu.find('input').not(':checked');
661+
return this.menu.find('input').not(':checked');
661662
},
662663

663664
destroy: function() {

0 commit comments

Comments
 (0)