]> source.dussan.org Git - jquery-ui.git/commitdiff
All: Consolidate `.removeAttr()` calls
authorScott González <scott.gonzalez@gmail.com>
Wed, 18 Mar 2015 00:22:49 +0000 (20:22 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 18 Mar 2015 14:39:25 +0000 (10:39 -0400)
Closes gh-1505

ui/accordion.js
ui/button.js
ui/menu.js
ui/progressbar.js
ui/spinner.js
ui/tabs.js

index 65067cba99e991ae1c0491262ba5d89f5d0abd7f..67021784dc595af96c4328bb3ac17eafaf0ebfc0 100644 (file)
@@ -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" ) {
index 4d197819a2f02c92c879d6923a75f9b561c78131..5182b1f1201ef8d14ffb8e1d0aa431e755c3d9d8 100644 (file)
@@ -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 ) {
index 83a22188ab2761c90d125a39741332913a4d105f..286a2efc4bfae77ac81983224ab4080abd05496e 100644 (file)
@@ -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();
 
index 69e550c58cd8d2ed559cff0f86ae3f7edc5d7f7a..4dc44d22ab39f44965ac07bde8200fff90005774 100644 (file)
@@ -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();
        },
index ff0c4088502ee231b851c86b40f9dde8c0845d7b..870b2cd8935d35a7fe1fe9aaaa6fc034eef59ac2 100644 (file)
@@ -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 );
        },
index 4ecfacaf34eecbd28f1c9b80fa46cf4ba10d5543..59f95819662d30a72c930df5be7347e5e02b29ce 100644 (file)
@@ -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" );
                        }
                } );