aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2015-03-17 20:22:49 -0400
committerScott González <scott.gonzalez@gmail.com>2015-03-18 10:39:25 -0400
commitc16a5e58f9e4c130d15e86898e62707c43877ab4 (patch)
tree896d62a7d711976c767889fa5a6871623584e672
parent8bcd363ae640bbefc28b720c1ab58b7992ea7044 (diff)
downloadjquery-ui-c16a5e58f9e4c130d15e86898e62707c43877ab4.tar.gz
jquery-ui-c16a5e58f9e4c130d15e86898e62707c43877ab4.zip
All: Consolidate `.removeAttr()` calls
Closes gh-1505
-rw-r--r--ui/accordion.js10
-rw-r--r--ui/button.js3
-rw-r--r--ui/menu.js15
-rw-r--r--ui/progressbar.js6
-rw-r--r--ui/spinner.js6
-rw-r--r--ui/tabs.js14
6 files changed, 12 insertions, 42 deletions
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" );
}
} );