Merge pull request #2711 from Wilto/disabled-sliders-selects

Fixes #2541 — Properly applies “disabled” styling and logic to custom form inputs. Thanks Wilto!
This commit is contained in:
Todd Parker 2011-10-14 14:21:16 -07:00
commit d869cab1f0
2 changed files with 6 additions and 2 deletions

View file

@ -122,7 +122,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
}
// Disable if specified
if ( options.disabled ) {
if ( options.disabled || this.element.attr('disabled')) {
this.disable();
}

View file

@ -215,7 +215,11 @@ $.widget( "mobile.slider", $.mobile.widget, {
},
refresh: function( val, isfromControl, preventInputUpdate ) {
if ( this.options.disabled ) { return; }
if ( this.options.disabled || this.element.attr('disabled')) {
this.slider.addClass('ui-disabled');
return;
}
var control = this.element, percent,
cType = control[0].nodeName.toLowerCase(),