Permalink
Browse files

[button] Implement _setOption() -- Fixes #4317

  • Loading branch information...
gabrielschulhof committed Oct 30, 2012
1 parent 7273a5e commit 2e21c6b92a2fc919c46244874de9da7a52173b50
Showing with 12 additions and 0 deletions.
  1. +12 −0 js/widgets/forms/button.js
View
@@ -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 );

1 comment on commit 2e21c6b

@johnbender

This comment has been minimized.

Show comment
Hide comment
@johnbender

johnbender Nov 2, 2012

Contributor

@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!

Contributor

johnbender commented on 2e21c6b Nov 2, 2012

@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.