Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Stop the call structure for slider updates earlier on disabled inputs F…
Browse files Browse the repository at this point in the history
…ixes #4770
  • Loading branch information
johnbender committed Jul 30, 2012
1 parent 4998f8c commit e0a27f8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion js/widgets/forms/slider.js
Expand Up @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit e0a27f8

Please sign in to comment.