Permalink
Browse files

Fixes #2541 — Properly applies “disabled” styling and logic to flip …

…switches, sliders, and custom selects based on disabled attribute in underlying input markup.
  • Loading branch information...
Wilto committed Oct 14, 2011
1 parent 0f81773 commit d0fc381d6b69fe732152626232296887c213a842
Showing with 6 additions and 2 deletions.
  1. +1 −1 js/jquery.mobile.forms.select.js
  2. +5 −1 js/jquery.mobile.forms.slider.js
@@ -122,7 +122,7 @@ $.widget( "mobile.selectmenu", $.mobile.widget, {
}
// Disable if specified
- if ( options.disabled ) {
+ if ( options.disabled || this.element.attr('disabled')) {
this.disable();
}
@@ -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(),

0 comments on commit d0fc381

Please sign in to comment.