equals( element.attr( "role" ), "tablist", "main role" );
equals( headers.attr( "role" ), "tab", "tab roles" );
equals( headers.next().attr( "role" ), "tabpanel", "tabpanel roles" );
- equals( headers.eq( 1 ).attr( "aria-expanded" ), "true", "active tab has aria-expanded" );
- equals( headers.eq( 0 ).attr( "aria-expanded" ), "false", "inactive tab has aria-expanded" );
- equals( headers.eq( 1 ).attr( "aria-selected" ), "true", "active tab has aria-selected" );
- equals( headers.eq( 0 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected" );
+ equals( headers.eq( 1 ).prop( "aria-expanded" ), true, "active tab has aria-expanded" );
+ equals( headers.eq( 0 ).prop( "aria-expanded" ), false, "inactive tab has aria-expanded" );
+ equals( headers.eq( 1 ).prop( "aria-selected" ), true, "active tab has aria-selected" );
+ equals( headers.eq( 0 ).prop( "aria-selected" ), false, "inactive tab has aria-selected" );
element.accordion( "option", "active", 0 );
- equals( headers.eq( 0 ).attr( "aria-expanded" ), "true", "newly active tab has aria-expanded" );
- equals( headers.eq( 1 ).attr( "aria-expanded" ), "false", "newly inactive tab has aria-expanded" );
- equals( headers.eq( 0 ).attr( "aria-selected" ), "true", "active tab has aria-selected" );
- equals( headers.eq( 1 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected" );
+ equals( headers.eq( 0 ).prop( "aria-expanded" ), true, "newly active tab has aria-expanded" );
+ equals( headers.eq( 1 ).prop( "aria-expanded" ), false, "newly inactive tab has aria-expanded" );
+ equals( headers.eq( 0 ).prop( "aria-selected" ), true, "active tab has aria-selected" );
+ equals( headers.eq( 1 ).prop( "aria-selected" ), false, "inactive tab has aria-selected" );
});
}( jQuery ) );
module("button: options");
-test("disabled, explicity value", function() {
+test("disabled, explicit value", function() {
$("#radio01").button({ disabled: false });
same(false, $("#radio01").button("option", "disabled"),
"disabled option set to false");
- same(false, $("#radio01").attr("disabled"), "element is disabled");
+ same(false, $("#radio01").prop("disabled"), "element is disabled");
$("#radio02").button({ disabled: true });
same(true, $("#radio02").button("option", "disabled"),
"disabled option set to true");
- same(true, $("#radio02").attr("disabled"), "element is not disabled");
+ same(true, $("#radio02").prop("disabled"), "element is not disabled");
});
test("disabled, null", function() {
$("#radio01").button({ disabled: null });
same(false, $("#radio01").button("option", "disabled"),
"disabled option set to false");
- same(false, $("#radio01").attr("disabled"), "element is disabled");
+ same(false, $("#radio01").prop("disabled"), "element is disabled");
- $("#radio02").attr("disabled", "disabled").button({ disabled: null });
+ $("#radio02").prop("disabled", true).button({ disabled: null });
same(true, $("#radio02").button("option", "disabled"),
"disabled option set to true");
- same(true, $("#radio02").attr("disabled"), "element is not disabled");
+ same(true, $("#radio02").prop("disabled"), "element is not disabled");
});
test("text false without icon", function() {
<span id="spanTabindex-50" tabindex="-50">.</span>
</div>
- <div>
- <input id="inputTabindexfoo" tabindex="foo" />
- <input id="inputTabindex3foo" tabindex="3foo" />
-
- <span id="spanTabindexfoo" tabindex="foo">.</span>
- <span id="spanTabindex3foo" tabindex="3foo">.</span>
- </div>
-
<div id="zIndex100" style="z-index: 100; position: absolute">
<div id="zIndexAutoWithParent">.</div>
</div>
isFocusable('#spanTabindex-50', 'span, tabindex -50');
});
-test("focusable - invalid tabindex", function() {
- expect(4);
-
- isFocusable('#inputTabindexfoo', 'input, tabindex foo');
- isFocusable('#inputTabindex3foo', 'input, tabindex 3foo');
- isNotFocusable('#spanTabindexfoo', 'span tabindex foo');
- isNotFocusable('#spanTabindex3foo', 'span, tabindex 3foo');
-});
-
test("focusable - area elements", function() {
isNotFocusable('#areaCoordsNoHref', 'coords but no href');
isFocusable('#areaCoordsHref', 'coords and href');
isNotTabbable('#spanTabindex-50', 'span, tabindex -50');
});
-test("tabbable - invalid tabindex", function() {
- expect(4);
-
- isTabbable('#inputTabindexfoo', 'input, tabindex foo');
- isTabbable('#inputTabindex3foo', 'input, tabindex 3foo');
- isNotTabbable('#spanTabindexfoo', 'span tabindex foo');
- isNotTabbable('#spanTabindex3foo', 'span, tabindex 3foo');
-});
-
test("tabbable - area elements", function() {
isNotTabbable('#areaCoordsNoHref', 'coords but no href');
isTabbable('#areaCoordsHref', 'coords and href');
var dp = $('.ui-datepicker-inline', inl);
ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - initially marked as enabled');
ok(!dp.children().is('.ui-state-disabled'), 'Enable/disable inline - not visually disabled initially');
- ok(!dp.find('select').attr('disabled'), 'Enable/disable inline - form element enabled initially');
+ ok(!dp.find('select').prop('disabled'), 'Enable/disable inline - form element enabled initially');
inl.datepicker('disable');
ok(inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as disabled');
ok(dp.children().is('.ui-state-disabled'), 'Enable/disable inline - visually disabled');
- ok(dp.find('select').attr('disabled'), 'Enable/disable inline - form element disabled');
+ ok(dp.find('select').prop('disabled'), 'Enable/disable inline - form element disabled');
inl.datepicker('enable');
ok(!inl.datepicker('isDisabled'), 'Enable/disable inline - now marked as enabled');
ok(!dp.children().is('.ui-state-disabled'), 'Enable/disable inline - not visiually disabled');
- ok(!dp.find('select').attr('disabled'), 'Enable/disable inline - form element enabled');
+ ok(!dp.find('select').prop('disabled'), 'Enable/disable inline - form element enabled');
inl.datepicker('destroy');
});
test('autoSize', function() {
var inp = init('#inp');
- equals(inp.attr('size'), 20, 'Auto size - default');
+ equals(inp.prop('size'), 20, 'Auto size - default');
inp.datepicker('option', 'autoSize', true);
- equals(inp.attr('size'), 10, 'Auto size - mm/dd/yy');
+ equals(inp.prop('size'), 10, 'Auto size - mm/dd/yy');
inp.datepicker('option', 'dateFormat', 'm/d/yy');
- equals(inp.attr('size'), 10, 'Auto size - m/d/yy');
+ equals(inp.prop('size'), 10, 'Auto size - m/d/yy');
inp.datepicker('option', 'dateFormat', 'D M d yy');
- equals(inp.attr('size'), 15, 'Auto size - D M d yy');
+ equals(inp.prop('size'), 15, 'Auto size - D M d yy');
inp.datepicker('option', 'dateFormat', 'DD, MM dd, yy');
- equals(inp.attr('size'), 29, 'Auto size - DD, MM dd, yy');
- inp.removeAttr('size');
+ equals(inp.prop('size'), 29, 'Auto size - DD, MM dd, yy');
// French
inp.datepicker('option', $.extend({autoSize: false}, $.datepicker.regional['fr']));
- equals(inp.attr('size'), 20, 'Auto size - fr - default');
+ equals(inp.prop('size'), 29, 'Auto size - fr - default');
inp.datepicker('option', 'autoSize', true);
- equals(inp.attr('size'), 10, 'Auto size - fr - dd/mm/yy');
+ equals(inp.prop('size'), 10, 'Auto size - fr - dd/mm/yy');
inp.datepicker('option', 'dateFormat', 'm/d/yy');
- equals(inp.attr('size'), 10, 'Auto size - fr - m/d/yy');
+ equals(inp.prop('size'), 10, 'Auto size - fr - m/d/yy');
inp.datepicker('option', 'dateFormat', 'D M d yy');
- equals(inp.attr('size'), 18, 'Auto size - fr - D M d yy');
+ equals(inp.prop('size'), 18, 'Auto size - fr - D M d yy');
inp.datepicker('option', 'dateFormat', 'DD, MM dd, yy');
- equals(inp.attr('size'), 28, 'Auto size - fr - DD, MM dd, yy');
- inp.removeAttr('size');
+ equals(inp.prop('size'), 28, 'Auto size - fr - DD, MM dd, yy');
// Hebrew
inp.datepicker('option', $.extend({autoSize: false}, $.datepicker.regional['he']));
- equals(inp.attr('size'), 20, 'Auto size - he - default');
+ equals(inp.prop('size'), 28, 'Auto size - he - default');
inp.datepicker('option', 'autoSize', true);
- equals(inp.attr('size'), 10, 'Auto size - he - dd/mm/yy');
+ equals(inp.prop('size'), 10, 'Auto size - he - dd/mm/yy');
inp.datepicker('option', 'dateFormat', 'm/d/yy');
- equals(inp.attr('size'), 10, 'Auto size - he - m/d/yy');
+ equals(inp.prop('size'), 10, 'Auto size - he - m/d/yy');
inp.datepicker('option', 'dateFormat', 'D M d yy');
- equals(inp.attr('size'), 14, 'Auto size - he - D M d yy');
+ equals(inp.prop('size'), 14, 'Auto size - he - D M d yy');
inp.datepicker('option', 'dateFormat', 'DD, MM dd, yy');
- equals(inp.attr('size'), 23, 'Auto size - he - DD, MM dd, yy');
- inp.removeAttr('size');
+ equals(inp.prop('size'), 23, 'Auto size - he - DD, MM dd, yy');
});
test('daylightSaving', function() {
ok(day21.is('.ui-datepicker-unselectable'), 'Before show day - unselectable 21');
ok(day20.is('.day10'), 'Before show day - CSS 20');
ok(!day21.is('.day10'), 'Before show day - CSS 21');
- ok(day20.attr('title') == '', 'Before show day - title 20');
+ ok(!day20.attr('title'), 'Before show day - title 20');
ok(day21.attr('title') == 'Divisble by 3', 'Before show day - title 21');
inp.datepicker('hide').datepicker('destroy');
});
expect(2);
d1 = $('<form><input type="radio" name="radio" id="a" value="a" checked="checked"></input>' +
- '<input type="radio" name="radio" id="b" value="b">b</input></form>').dialog({autoOpen: false});
+ '<input type="radio" name="radio" id="b" value="b">b</input></form>').appendTo( "body" ).dialog({autoOpen: false});
- d1.find('#b')[0].checked = true;
+ d1.find('#b').prop( "checked", true );
equal($('input:checked').val(), 'b', "checkbox b is checked");
- d2 = $('<div></div>').dialog({autoOpen: false});
-
d1.dialog('open');
equal($('input:checked').val(), 'b', "checkbox b is checked");
- d1.add(d2).remove();
+ d1.remove();
});
test("#6645: Missing element not found check in overlay", function(){
el.progressbar("value", 77);
equals(el.attr("aria-valuenow"), 77, "aria-valuenow");
el.progressbar("disable");
- equals(el.attr("aria-disabled"), "true", "aria-disabled on");
+ equals(el.prop("aria-disabled"), true, "aria-disabled on");
el.progressbar("enable");
// FAIL: for some reason IE6 and 7 return a boolean false instead of the string
- equals(el.attr("aria-disabled"), $.browser.msie && $.browser.version == 6 || $.browser.version == 7 ? false : "false", "aria-disabled off");
+ equals(el.prop("aria-disabled"), false, "aria-disabled off");
});
})(jQuery);
var result = {};
result.nodeName = value[0].nodeName;
$.each(attributes, function(index, attr) {
- result[attr] = value.attr(attr);
+ result[attr] = value.prop(attr);
});
result.children = [];
var children = value.children();
element.tooltip( "disable" );
equal( $( ".ui-tooltip" ).length, 0, "no tooltip when disabled" );
- equal( tooltip.attr( "title" ), "", "title removed on disable" );
+ equal( tooltip.attr( "title" ), undefined, "title removed on disable" );
element.tooltip( "open" );
equal( $( ".ui-tooltip" ).length, 0, "open does nothing when disabled" );
self.headers
.not( self.active )
- .attr({
- "aria-expanded": "false",
- "aria-selected": "false",
- tabIndex: -1
+ .prop({
+ "aria-expanded": false,
+ "aria-selected": false
})
+ .attr( "tabIndex", -1 )
.next()
.hide();
self.headers.eq( 0 ).attr( "tabIndex", 0 );
} else {
self.active
- .attr({
- "aria-expanded": "true",
- "aria-selected": "true",
- tabIndex: 0
- });
+ .prop({
+ "aria-expanded": true,
+ "aria-selected": true
+ })
+ .attr( "tabIndex", 0 );
}
// only need links in tab order for Safari
.unbind( ".accordion" )
.removeClass( "ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
.removeAttr( "role" )
- .removeAttr( "aria-expanded" )
- .removeAttr( "aria-selected" )
+ .removeProp( "aria-expanded" )
+ .removeProp( "aria-selected" )
.removeAttr( "tabIndex" )
.find( "a" )
.removeAttr( "tabIndex" )
// TODO assert that the blur and focus triggers are really necessary, remove otherwise
toHide.prev()
- .attr({
- "aria-expanded": "false",
- "aria-selected": "false",
- tabIndex: -1
+ .prop({
+ "aria-expanded": false,
+ "aria-selected": false
})
+ .attr( "tabIndex", -1 )
.blur();
toShow.prev()
- .attr({
- "aria-expanded": "true",
- "aria-selected": "true",
- tabIndex: 0
+ .prop({
+ "aria-expanded": true,
+ "aria-selected": true
})
+ .attr( "tabIndex", 0 )
.focus();
},
// TODO verify these actually work as intended
.attr({
role: "textbox",
- "aria-autocomplete": "list",
- "aria-haspopup": "true"
+ "aria-autocomplete": "list"
})
+ .prop( "aria-haspopup", true )
.bind( "keydown.autocomplete", function( event ) {
- if ( self.options.disabled || self.element.attr( "readonly" ) ) {
+ if ( self.options.disabled || self.element.prop( "readonly" ) ) {
suppressKeyPress = true;
suppressInput = true;
return;
.removeAttr( "autocomplete" )
.removeAttr( "role" )
.removeAttr( "aria-autocomplete" )
- .removeAttr( "aria-haspopup" );
+ .removeProp( "aria-haspopup" );
this.menu.element.remove();
},
.bind( "reset.button", formResetHandler );
if ( typeof this.options.disabled !== "boolean" ) {
- this.options.disabled = this.element.attr( "disabled" );
+ this.options.disabled = this.element.prop( "disabled" );
}
this._determineButtonType();
return false;
}
$( this ).toggleClass( "ui-state-active" );
- self.buttonElement.attr( "aria-pressed", self.element[0].checked );
+ self.buttonElement.prop( "aria-pressed", self.element[0].checked );
});
} else if ( this.type === "radio" ) {
this.buttonElement.bind( "click.button", function() {
return false;
}
$( this ).addClass( "ui-state-active" );
- self.buttonElement.attr( "aria-pressed", true );
+ self.buttonElement.prop( "aria-pressed", true );
var radio = self.element[ 0 ];
radioGroup( radio )
return $( this ).button( "widget" )[ 0 ];
})
.removeClass( "ui-state-active" )
- .attr( "aria-pressed", false );
+ .prop( "aria-pressed", false );
});
} else {
this.buttonElement
if ( checked ) {
this.buttonElement.addClass( "ui-state-active" );
}
- this.buttonElement.attr( "aria-pressed", checked );
+ this.buttonElement.prop( "aria-pressed", checked );
} else {
this.buttonElement = this.element;
}
this.buttonElement
.removeClass( baseClasses + " " + stateClasses + " " + typeClasses )
.removeAttr( "role" )
- .removeAttr( "aria-pressed" )
+ .removeProp( "aria-pressed" )
.html( this.buttonElement.find(".ui-button-text").html() );
if ( !this.hasTitle ) {
this._super( "_setOption", key, value );
if ( key === "disabled" ) {
if ( value ) {
- this.element.attr( "disabled", true );
+ this.element.prop( "disabled", true );
} else {
- this.element.removeAttr( "disabled" );
+ this.element.prop( "disabled", false );
}
return;
}
if ( $( this ).is( ":checked" ) ) {
$( this ).button( "widget" )
.addClass( "ui-state-active" )
- .attr( "aria-pressed", true );
+ .prop( "aria-pressed", true );
} else {
$( this ).button( "widget" )
.removeClass( "ui-state-active" )
- .attr( "aria-pressed", false );
+ .prop( "aria-pressed", false );
}
});
} else if ( this.type === "checkbox" ) {
if ( this.element.is( ":checked" ) ) {
this.buttonElement
.addClass( "ui-state-active" )
- .attr( "aria-pressed", true );
+ .prop( "aria-pressed", true );
} else {
this.buttonElement
.removeClass( "ui-state-active" )
- .attr( "aria-pressed", false );
+ .prop( "aria-pressed", false );
}
}
},
date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ?
'dayNames' : 'dayNamesShort'))) + 20 - date.getDay());
}
- inst.input.attr('size', this._formatDate(inst, date).length);
+ inst.input.prop('size', this._formatDate(inst, date).length);
}
},
var inline = $target.children('.' + this._inlineClass);
inline.children().removeClass('ui-state-disabled');
inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
- removeAttr("disabled");
+ prop("disabled", false);
}
this._disabledInputs = $.map(this._disabledInputs,
function(value) { return (value == target ? null : value); }); // delete entry
var inline = $target.children('.' + this._inlineClass);
inline.children().addClass('ui-state-disabled');
inline.find("select.ui-datepicker-month, select.ui-datepicker-year").
- attr("disabled", "disabled");
+ prop("disabled", true);
}
this._disabledInputs = $.map(this._disabledInputs,
function(value) { return (value == target ? null : value); }); // delete entry
// Opera 9.5+ resets when parent z-index is changed.
// http://bugs.jqueryui.com/ticket/3193
saveScroll = {
- scrollTop: self.element.attr( "scrollTop" ),
- scrollLeft: self.element.attr( "scrollLeft" )
+ scrollTop: self.element.scrollTop(),
+ scrollLeft: self.element.scrollLeft()
};
$.ui.dialog.maxZ += 1;
self.uiDialog.css( "z-index", $.ui.dialog.maxZ );
.removeAttr( "role" )
.removeAttr("tabIndex")
.removeAttr( "aria-labelledby" )
- .removeAttr( "aria-expanded" )
- .removeAttr( "aria-hidden" )
+ .removeProp( "aria-expanded" )
+ .removeProp( "aria-hidden" )
.show();
//destroy menu items
.removeClass( "ui-corner-all ui-state-hover" )
.removeAttr( "tabIndex" )
.removeAttr( "role" )
- .removeAttr( "aria-haspopup" )
+ .removeProp( "aria-haspopup" )
.removeAttr( "id" )
.children(".ui-icon").remove();
},
.addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" )
.attr("role", "menu")
.hide()
- .attr("aria-hidden", "true")
- .attr("aria-expanded", "false")
- ;
+ .prop({
+ "aria-hidden": true,
+ "aria-expanded": false
+ });
// don't refresh list items that are already adapted
var items = submenus.add(this.element).children( "li:not(.ui-menu-item):has(a)" )
submenus.each(function() {
var menu = $(this);
var item = menu.prev("a")
- item.attr("aria-haspopup", "true")
+ item.prop("aria-haspopup", true)
.prepend('<span class="ui-menu-icon ui-icon ui-icon-carat-1-e"></span>');
menu.attr("aria-labelledby", item.attr("id"));
});
_open: function(submenu) {
clearTimeout(this.timer);
- this.element.find(".ui-menu").not(submenu.parents()).hide().attr("aria-hidden", "true");
+ this.element.find(".ui-menu").not(submenu.parents()).hide().prop("aria-hidden", true);
var position = $.extend({}, {
of: this.active
}, $.type(this.options.position) == "function"
? this.options.position(this.active)
: this.options.position
);
- submenu.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(position);
+ submenu.show().removeProp("aria-hidden").prop("aria-expanded", true).position(position);
},
closeAll: function() {
this.element
- .find("ul").hide().attr("aria-hidden", "true").attr("aria-expanded", "false").end()
+ .find("ul").hide().prop("aria-hidden", true).prop("aria-expanded", false).end()
.find("a.ui-state-active").removeClass("ui-state-active");
this.blur();
this.activeMenu = this.element;
_close: function() {
this.active.parent()
- .find("ul").hide().attr("aria-hidden", "true").attr("aria-expanded", "false").end()
+ .find("ul").hide().prop("aria-hidden", true).prop("aria-expanded", false).end()
.find("a.ui-state-active").removeClass("ui-state-active");
},
left: function(event) {
var newItem = this.active && this.active.parents("li:not(.ui-menubar-item)").first();
if (newItem && newItem.length) {
- this.active.parent().attr("aria-hidden", "true").attr("aria-expanded", "false").hide();
+ this.active.parent().prop("aria-hidden", true).prop("aria-expanded", false).hide();
this.focus(event, newItem);
return true;
}
},
_hasScroll: function() {
- // TODO: just use .prop() when we drop support for jQuery <1.6
- return this.element.height() < this.element[ $.fn.prop ? "prop" : "attr" ]( "scrollHeight" );
+ return this.element.height() < this.element.prop( "scrollHeight" );
},
select: function( event ) {
}
})
.hide()
- .attr( "aria-hidden", "true" )
- .attr( "aria-expanded", "false" )
+ .prop({
+ "aria-hidden": true,
+ "aria-expanded": false
+ })
.bind( "keydown.menubar", function( event ) {
var menu = $( this );
if ( menu.is( ":hidden" ) )
})
.addClass( "ui-button ui-widget ui-button-text-only ui-menubar-link" )
.attr( "role", "menuitem" )
- .attr( "aria-haspopup", "true" )
+ .prop( "aria-haspopup", true )
.wrapInner( "<span class='ui-button-text'></span>" );
// TODO review if these options are a good choice, maybe they can be merged
_destroy : function() {
var items = this.element.children( "li" )
.removeClass( "ui-menubar-item" )
- .removeAttr( "role", "presentation" )
+ .removeAttr( "role" )
.children( "button, a" );
this.element
.removeClass( "ui-menubar ui-widget-header ui-helper-clearfix" )
- .removeAttr( "role", "menubar" )
+ .removeAttr( "role" )
.unbind( ".menubar" );
items
.unbind( ".menubar" )
.removeClass( "ui-button ui-widget ui-button-text-only ui-menubar-link ui-state-default" )
- .removeAttr( "role", "menuitem" )
- .removeAttr( "aria-haspopup", "true" )
+ .removeAttr( "role" )
+ .removeProp( "aria-haspopup" )
// TODO unwrap?
.children( "span.ui-button-text" ).each(function( i, e ) {
var item = $( this );
this.element.find( ":ui-menu" )
.menu( "destroy" )
.show()
- .removeAttr( "aria-hidden", "true" )
- .removeAttr( "aria-expanded", "false" )
+ .removeProp( "aria-hidden" )
+ .removeProp( "aria-expanded" )
.removeAttr( "tabindex" )
.unbind( ".menubar" );
},
this.active
.menu( "closeAll" )
.hide()
- .attr( "aria-hidden", "true" )
- .attr( "aria-expanded", "false" );
+ .prop({
+ "aria-hidden": true,
+ "aria-expanded": false
+ });
this.active
.prev()
.removeClass( "ui-state-active" )
this.active
.menu( "closeAll" )
.hide()
- .attr( "aria-hidden", "true" )
- .attr( "aria-expanded", "false" );
+ .prop({
+ "aria-hidden": true,
+ "aria-expanded": false
+ });
this.active
.prev()
.removeClass( "ui-state-active" );
at: "left bottom",
of: button
})
- .removeAttr( "aria-hidden" )
- .attr( "aria-expanded", "true" )
+ .removeProp( "aria-hidden" )
+ .prop( "aria-expanded", true )
.menu("focus", event, menu.children( "li" ).first() )
// TODO need a comment here why both events are triggered
.focus()
}
this.options.trigger
- .attr( "aria-haspopup", true )
+ .prop( "aria-haspopup", true )
.attr( "aria-owns", this.element.attr( "id" ) );
this.element
this.element
.show()
.removeClass( "ui-popup" )
- .removeAttr( "aria-hidden" )
- .removeAttr( "aria-expanded" );
+ .removeProp( "aria-hidden" )
+ .removeProp( "aria-expanded" );
this.options.trigger
- .removeAttr( "aria-haspopup" )
+ .removeProp( "aria-haspopup" )
.removeAttr( "aria-owns" );
if ( this.generatedId ) {
this.element
.show()
- .attr( "aria-hidden", false )
- .attr( "aria-expanded", true )
+ .prop( "aria-hidden", false )
+ .prop( "aria-expanded", true )
.position( position )
// TODO find a focussable child, otherwise put focus on element, add tabIndex=0 if not focussable
.focus();
close: function( event ) {
this.element
.hide()
- .attr( "aria-hidden", true )
- .attr( "aria-expanded", false );
+ .prop( "aria-hidden", true )
+ .prop( "aria-expanded", false );
this.options.trigger.attr("tabindex", 0);
if ( value ) {
this.handles.filter( ".ui-state-focus" ).blur();
this.handles.removeClass( "ui-state-hover" );
- this.handles.attr( "disabled", "disabled" );
+ this.handles.prop( "disabled", true );
this.element.addClass( "ui-disabled" );
} else {
- this.handles.removeAttr( "disabled" );
+ this.handles.prop( "disabled", false );
this.element.removeClass( "ui-disabled" );
}
break;
if ( key === "disabled" ) {
if ( value ) {
- this.element.attr( "disabled", true );
+ this.element.prop( "disabled", true );
this.buttons.button( "disable" );
} else {
- this.element.removeAttr( "disabled" );
+ this.element.prop( "disabled", false );
this.buttons.button( "enable" );
}
}
destroy: function() {
this.element
.removeClass( "ui-spinner-input" )
- .removeAttr( "disabled" )
+ .prop( "disabled", false )
.removeAttr( "autocomplete" )
.removeAttr( "role" )
.removeAttr( "aria-valuemin" )
.removeData( this.widgetName );
this.widget()
.unbind( "." + this.widgetName )
- .removeAttr( "aria-disabled" )
+ .removeProp( "aria-disabled" )
.removeClass(
this.widgetBaseClass + "-disabled " +
"ui-state-disabled" );
if ( key === "disabled" ) {
this.widget()
.toggleClass( this.widgetBaseClass + "-disabled ui-state-disabled", !!value )
- .attr( "aria-disabled", value );
+ .prop( "aria-disabled", value );
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
}