Permalink
Browse files

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

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

Please sign in to comment.