mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
Update form button text on refresh.
Allows submit button values to change dynamically, and update accordingly in the UI. Such as in the event a button should read "Update" instead of "Save".
This commit is contained in:
parent
1c3a4c7a84
commit
6b767b4b8d
1 changed files with 5 additions and 1 deletions
|
|
@ -79,11 +79,15 @@ $.widget( "mobile.button", $.mobile.widget, {
|
|||
},
|
||||
|
||||
refresh: function() {
|
||||
if ( this.element.attr( "disabled" ) ) {
|
||||
var $el = this.element;
|
||||
|
||||
if ( $el.attr( "disabled" ) ) {
|
||||
this.disable();
|
||||
} else {
|
||||
this.enable();
|
||||
}
|
||||
|
||||
this.button.find( ".ui-btn-text" ).text( $el.text() || $el.val() );
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue