diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-06-08 17:02:57 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-06-08 17:02:57 -0400 |
commit | da84672db8ad1f3909e645a665e9a9c6c0de0ded (patch) | |
tree | bf6261b0059b0bd716ec6df9196c01c38c02216b /ui/jquery.ui.button.js | |
parent | 7cd3d0a99ec4c92671aa637d322a41300786d879 (diff) | |
download | jquery-ui-da84672db8ad1f3909e645a665e9a9c6c0de0ded.tar.gz jquery-ui-da84672db8ad1f3909e645a665e9a9c6c0de0ded.zip |
.attr() -> .prop()
Diffstat (limited to 'ui/jquery.ui.button.js')
-rw-r--r-- | ui/jquery.ui.button.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 482cdc24c..5f48f69a2 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -58,7 +58,7 @@ $.widget( "ui.button", { .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(); @@ -147,7 +147,7 @@ $.widget( "ui.button", { 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() { @@ -155,7 +155,7 @@ $.widget( "ui.button", { 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 ) @@ -164,7 +164,7 @@ $.widget( "ui.button", { return $( this ).button( "widget" )[ 0 ]; }) .removeClass( "ui-state-active" ) - .attr( "aria-pressed", false ); + .prop( "aria-pressed", false ); }); } else { this.buttonElement @@ -244,7 +244,7 @@ $.widget( "ui.button", { 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; } @@ -260,7 +260,7 @@ $.widget( "ui.button", { 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 ) { @@ -272,9 +272,9 @@ $.widget( "ui.button", { 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; } @@ -291,22 +291,22 @@ $.widget( "ui.button", { 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 ); } } }, |