Skip to content

Commit 7bf048a

Browse files
committed
I noticed that the code in the mouseup for the toggle switch was using a CSS3 transition, but calling the animationComplete() function which waits for an animationend event which will never come. This means we bind a new animationComplete() handler every time the toggle switch is clicked.
I removed the binding for the handler completely since it doesn't hurt to just leave the transition in place. I also removed the code that was setting the position of the slider since it really should only be set within the mouseup if the user did not change the switch setting (toggle).
1 parent a27f7d3 commit 7bf048a

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

js/jquery.mobile.forms.slider.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,9 @@ $.widget( "mobile.slider", $.mobile.widget, {
140140

141141
if ( !self.userModified ) {
142142
//tap occurred, but value didn't change. flip it!
143+
handle.addClass( "ui-slider-handle-snapping" );
143144
self.refresh( !self.beforeStart ? 1 : 0 );
144145
}
145-
var curval = val();
146-
var snapped = Math.round( curval / ( max - min ) * 100 );
147-
handle
148-
.addClass( "ui-slider-handle-snapping" )
149-
.css( "left", snapped + "%" )
150-
.animationComplete( function() {
151-
handle.removeClass( "ui-slider-handle-snapping" );
152-
});
153146
}
154147
return false;
155148
}

0 commit comments

Comments
 (0)