mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-17 06:20:26 +00:00
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).
This commit is contained in:
parent
a27f7d355f
commit
7bf048a214
1 changed files with 1 additions and 8 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue