From 3f6ba8b1c8df86a2c482d91c947a10edcdddca35 Mon Sep 17 00:00:00 2001 From: cm71td Date: Wed, 23 Mar 2011 15:42:54 -0700 Subject: [PATCH] Disabled buttons should get the ui-disabled class. I created a refresh() method to be consistent with other widgets. It checks if the underlying button is disabled and calls enable or disable. The refresh() method is called from _create. --- js/jquery.mobile.forms.button.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/jquery.mobile.forms.button.js b/js/jquery.mobile.forms.button.js index 41efa1ecff9..390494fe111 100644 --- a/js/jquery.mobile.forms.button.js +++ b/js/jquery.mobile.forms.button.js @@ -48,6 +48,7 @@ $.widget( "mobile.button", $.mobile.widget, { }); }); } + this.refresh(); }, @@ -61,6 +62,15 @@ $.widget( "mobile.button", $.mobile.widget, { this.element.attr("disabled", true); this.button.addClass("ui-disabled").attr("aria-disabled", true); return this._setOption("disabled", true); + }, + + refresh: function(){ + if( this.element.attr('disabled') ){ + this.disable(); + } + else{ + this.enable(); + } } }); })( jQuery ); \ No newline at end of file