Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Stop the call structure for slider updates earlier on disabled inputs…

… Fixes #4770
  • Loading branch information...
commit e0a27f8c0de0792aad798f75209b1fba9f5ed19b 1 parent 4998f8c
@johnbender johnbender authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 js/widgets/forms/slider.js
View
12 js/widgets/forms/slider.js
@@ -154,7 +154,9 @@ $.widget( "mobile.slider", $.mobile.widget, {
// prevent screen drag when slider activated
$( document ).bind( "vmousemove", function( event ) {
- if ( self.dragging ) {
+ // NOTE: we don't do this in refresh because we still want to
+ // support programmatic alteration of disabled inputs
+ if ( self.dragging && !self.options.disabled ) {
// self.mouseMoved must be updated before refresh() because it will be used in the control "change" event
self.mouseMoved = true;
@@ -177,6 +179,12 @@ $.widget( "mobile.slider", $.mobile.widget, {
control.bind( "vmouseup", $.proxy( self._checkedRefresh, self));
slider.bind( "vmousedown", function( event ) {
+ // NOTE: we don't do this in refresh because we still want to
+ // support programmatic alteration of disabled inputs
+ if ( self.options.disabled ) {
+ return false;
+ }
+
self.dragging = true;
self.userModified = false;
self.mouseMoved = false;
@@ -321,6 +329,8 @@ $.widget( "mobile.slider", $.mobile.widget, {
refresh: function( val, isfromControl, preventInputUpdate ) {
+ // NOTE: we don't return here because we want to support programmatic
+ // alteration of the input value, which should still update the slider
if ( this.options.disabled || this.element.attr('disabled')) {
this.disable();
}
Please sign in to comment.
Something went wrong with that request. Please try again.