Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
[button] Implement _setOption() -- Fixes #4317
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Schulhof committed Oct 30, 2012
1 parent 7273a5e commit 2e21c6b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/widgets/forms/button.js
Expand Up @@ -119,6 +119,18 @@ $.widget( "mobile.button", $.mobile.widget, {
this.refresh();
},

_setOption: function( key, value ) {
var op = {};

op[ key ] = value;
if ( key !== "initSelector" ) {
this.button.buttonMarkup( op );
// Record the option change in the options and in the DOM data-* attributes
this.element.attr( "data-" + ( $.mobile.ns || "" ) + ( key.replace( /([A-Z])/, "-$1" ).toLowerCase() ), value );
}
this._super( "_setOption", key, value );
},

enable: function() {
this.element.attr( "disabled", false );
this.button.removeClass( "ui-disabled" ).attr( "aria-disabled", false );
Expand Down

1 comment on commit 2e21c6b

@johnbender
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gabrielschulhof

Cool, so this only supports the programmatic update of the theme value which I'm totally fine with. I think @toddparker and I were thinking you had added support for altering the markup and expecting the button to change themes.

BUENO!

Please sign in to comment.