Skip to content

Commit 3f6ba8b

Browse files
committed
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.
1 parent 862c011 commit 3f6ba8b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

js/jquery.mobile.forms.button.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ $.widget( "mobile.button", $.mobile.widget, {
4848
});
4949
});
5050
}
51+
this.refresh();
5152

5253
},
5354

@@ -61,6 +62,15 @@ $.widget( "mobile.button", $.mobile.widget, {
6162
this.element.attr("disabled", true);
6263
this.button.addClass("ui-disabled").attr("aria-disabled", true);
6364
return this._setOption("disabled", true);
65+
},
66+
67+
refresh: function(){
68+
if( this.element.attr('disabled') ){
69+
this.disable();
70+
}
71+
else{
72+
this.enable();
73+
}
6474
}
6575
});
6676
})( jQuery );

0 commit comments

Comments
 (0)