Fixes #2541 — Properly applies “disabled” styling and logic to flip switches, sliders, and custom selects based on disabled attribute in underlying input markup.

This commit is contained in:
Mat Marquis 2011-10-14 17:15:41 -04:00
parent 0f81773a42
commit d0fc381d6b
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(),