mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-26 09:04:43 +00:00
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.
This commit is contained in:
parent
ff4c74d5f9
commit
2f3b5b6543
1 changed files with 10 additions and 0 deletions
|
|
@ -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 );
|
||||
Loading…
Reference in a new issue