});\r
\r
test("ARIA attributes", function() {\r
- var el = $('#spin').spinner({ min: -5, max: 5, value: 2 }),\r
- wrapper = el.spinner("widget");\r
+ var el = $('#spin').spinner({ min: -5, max: 5, value: 2 });;\r
\r
- equals(wrapper.attr('role'), 'spinbutton', 'role');\r
- equals(wrapper.attr('aria-valuemin'), -5, 'aria-valuemin');\r
- equals(wrapper.attr('aria-valuemax'), 5, 'aria-valuemax');\r
- equals(wrapper.attr('aria-valuenow'), 2, 'aria-valuenow');\r
+ equals(el.attr('role'), 'spinbutton', 'role');\r
+ equals(el.attr('aria-valuemin'), -5, 'aria-valuemin');\r
+ equals(el.attr('aria-valuemax'), 5, 'aria-valuemax');\r
+ equals(el.attr('aria-valuenow'), 2, 'aria-valuenow');\r
\r
el.spinner('stepUp');\r
\r
- equals(wrapper.attr('aria-valuenow'), 3, 'stepUp 1 step changes aria-valuenow');\r
+ equals(el.attr('aria-valuenow'), 3, 'stepUp 1 step changes aria-valuenow');\r
\r
el.spinner('option', { min: -10, max: 10 });\r
\r
- equals(wrapper.attr('aria-valuemin'), -10, 'min option changed aria-valuemin changes');\r
- equals(wrapper.attr('aria-valuemax'), 10, 'max option changed aria-valuemax changes');\r
+ equals(el.attr('aria-valuemin'), -10, 'min option changed aria-valuemin changes');\r
+ equals(el.attr('aria-valuemax'), 10, 'max option changed aria-valuemax changes');\r
});\r
\r
})(jQuery);\r
});
this.element
+ .attr( "role", "spinbutton" )
.bind('keydown.spinner', function(event) {
if (self.options.disabled) {
return;
},
_uiSpinnerHtml: function() {
- return '<span role="spinbutton" class="ui-spinner ui-state-default ui-widget ui-widget-content ui-corner-all"></span>';
+ return '<span class="ui-spinner ui-state-default ui-widget ui-widget-content ui-corner-all"></span>';
},
_buttonHtml: function() {
this.element
.removeClass('ui-spinner-input')
.removeAttr('disabled')
- .removeAttr('autocomplete');
+ .removeAttr('autocomplete')
+ .removeAttr('role')
+ .removeAttr('aria-valuemin')
+ .removeAttr('aria-valuemax')
+ .removeAttr('aria-valuenow');
this._super( "destroy" );
this.uiSpinner.replaceWith(this.element);
},