From: Scott González Date: Wed, 18 Mar 2015 00:22:49 +0000 (-0400) Subject: All: Consolidate `.removeAttr()` calls X-Git-Tag: 1.12.0-beta.1~360 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c16a5e58f9e4c130d15e86898e62707c43877ab4;p=jquery-ui.git All: Consolidate `.removeAttr()` calls Closes gh-1505 --- diff --git a/ui/accordion.js b/ui/accordion.js index 65067cba9..67021784d 100644 --- a/ui/accordion.js +++ b/ui/accordion.js @@ -127,11 +127,7 @@ return $.widget( "ui.accordion", { // clean up headers this.headers - .removeAttr( "role" ) - .removeAttr( "aria-expanded" ) - .removeAttr( "aria-selected" ) - .removeAttr( "aria-controls" ) - .removeAttr( "tabIndex" ) + .removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" ) .removeUniqueId(); this._destroyIcons(); @@ -139,9 +135,7 @@ return $.widget( "ui.accordion", { // clean up content panels contents = this.headers.next() .css( "display", "" ) - .removeAttr( "role" ) - .removeAttr( "aria-hidden" ) - .removeAttr( "aria-labelledby" ) + .removeAttr( "role aria-hidden aria-labelledby" ) .removeUniqueId(); if ( this.options.heightStyle !== "content" ) { diff --git a/ui/button.js b/ui/button.js index 4d197819a..5182b1f12 100644 --- a/ui/button.js +++ b/ui/button.js @@ -253,8 +253,7 @@ $.widget( "ui.button", { .removeClass( "ui-helper-hidden-accessible" ); this.buttonElement .removeClass( baseClasses + " ui-state-active " + typeClasses ) - .removeAttr( "role" ) - .removeAttr( "aria-pressed" ) + .removeAttr( "role aria-pressed" ) .html( this.buttonElement.find(".ui-button-text").html() ); if ( !this.hasTitle ) { diff --git a/ui/menu.js b/ui/menu.js index 83a22188a..286a2efc4 100644 --- a/ui/menu.js +++ b/ui/menu.js @@ -160,24 +160,17 @@ return $.widget( "ui.menu", { _destroy: function() { var items = this.element.find( ".ui-menu-item" ) - .removeAttr( "role" ) - .removeAttr( "aria-disabled" ), + .removeAttr( "role aria-disabled" ), submenus = items.children( ".ui-menu-item-wrapper" ) .removeUniqueId() - .removeAttr( "tabIndex" ) - .removeAttr( "role" ) - .removeAttr( "aria-haspopup" ); + .removeAttr( "tabIndex role aria-haspopup" ); // Destroy (sub)menus this.element .removeAttr( "aria-activedescendant" ) .find( ".ui-menu" ).addBack() - .removeAttr( "role" ) - .removeAttr( "tabIndex" ) - .removeAttr( "aria-labelledby" ) - .removeAttr( "aria-expanded" ) - .removeAttr( "aria-hidden" ) - .removeAttr( "aria-disabled" ) + .removeAttr( "role aria-labelledby aria-expanded aria-hidden aria-disabled " + + "tabIndex" ) .removeUniqueId() .show(); diff --git a/ui/progressbar.js b/ui/progressbar.js index 69e550c58..4dc44d22a 100644 --- a/ui/progressbar.js +++ b/ui/progressbar.js @@ -69,11 +69,7 @@ return $.widget( "ui.progressbar", { }, _destroy: function() { - this.element - .removeAttr( "role" ) - .removeAttr( "aria-valuemin" ) - .removeAttr( "aria-valuemax" ) - .removeAttr( "aria-valuenow" ); + this.element.removeAttr( "role aria-valuemin aria-valuemax aria-valuenow" ); this.valueDiv.remove(); }, diff --git a/ui/spinner.js b/ui/spinner.js index ff0c40885..870b2cd89 100644 --- a/ui/spinner.js +++ b/ui/spinner.js @@ -488,11 +488,7 @@ return $.widget( "ui.spinner", { _destroy: function() { this.element .prop( "disabled", false ) - .removeAttr( "autocomplete" ) - .removeAttr( "role" ) - .removeAttr( "aria-valuemin" ) - .removeAttr( "aria-valuemax" ) - .removeAttr( "aria-valuenow" ); + .removeAttr( "autocomplete role aria-valuemin aria-valuemax aria-valuenow" ); this.uiSpinner.replaceWith( this.element ); }, diff --git a/ui/tabs.js b/ui/tabs.js index 4ecfacaf3..59f958196 100644 --- a/ui/tabs.js +++ b/ui/tabs.js @@ -729,23 +729,15 @@ return $.widget( "ui.tabs", { .unbind( this.eventNamespace ); this.anchors - .removeAttr( "role" ) - .removeAttr( "tabIndex" ) + .removeAttr( "role tabIndex" ) .removeUniqueId(); this.tabs.add( this.panels ).each( function() { if ( $.data( this, "ui-tabs-destroy" ) ) { $( this ).remove(); } else { - $( this ) - .removeAttr( "tabIndex" ) - .removeAttr( "aria-live" ) - .removeAttr( "aria-busy" ) - .removeAttr( "aria-selected" ) - .removeAttr( "aria-labelledby" ) - .removeAttr( "aria-hidden" ) - .removeAttr( "aria-expanded" ) - .removeAttr( "role" ); + $( this ).removeAttr( "role tabIndex " + + "aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded" ); } } );