From 7bf048a214b635c66f882ffddba80b27698ebbc3 Mon Sep 17 00:00:00 2001 From: Kin Blas Date: Thu, 1 Sep 2011 15:42:30 -0700 Subject: [PATCH] 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). --- js/jquery.mobile.forms.slider.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/js/jquery.mobile.forms.slider.js b/js/jquery.mobile.forms.slider.js index 13ac9d86..9195fca1 100644 --- a/js/jquery.mobile.forms.slider.js +++ b/js/jquery.mobile.forms.slider.js @@ -140,16 +140,9 @@ $.widget( "mobile.slider", $.mobile.widget, { if ( !self.userModified ) { //tap occurred, but value didn't change. flip it! + handle.addClass( "ui-slider-handle-snapping" ); self.refresh( !self.beforeStart ? 1 : 0 ); } - var curval = val(); - var snapped = Math.round( curval / ( max - min ) * 100 ); - handle - .addClass( "ui-slider-handle-snapping" ) - .css( "left", snapped + "%" ) - .animationComplete( function() { - handle.removeClass( "ui-slider-handle-snapping" ); - }); } return false; }