mirror of
https://github.com/flynx/PortableMag.git
synced 2025-10-29 11:10:08 +00:00
fixed an idiotic slowdown in dragging (swipeHandler)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
f7322ee74a
commit
48e9bb61fd
@ -105,23 +105,24 @@ function swipeHandler(evt, phase, direction, distance, duration, fingers){
|
||||
&& (DRAG_FULL_PAGE || !_PAGE_VIEW)
|
||||
&& (direction=='left' || direction=='right')){
|
||||
// using the "unanimated" trick we will make the drag real-time...
|
||||
mag.addClass('unanimated')
|
||||
if(direction == 'left'){
|
||||
mag.css({left: -n*cur.width()-distance/scale})
|
||||
} else if(direction == 'right') {
|
||||
mag.css({left: -n*cur.width()+distance/scale})
|
||||
}
|
||||
setTimeout(function(){mag.removeClass('unanimated')}, 5)
|
||||
|
||||
} else if(phase == 'start') {
|
||||
togglePageDragging('on')
|
||||
mag.addClass('unanimated')
|
||||
|
||||
} else if(phase == 'cancel') {
|
||||
togglePageDragging('off')
|
||||
setCurrentPage()
|
||||
mag.removeClass('unanimated')
|
||||
|
||||
} else if(phase =='end' ) {
|
||||
togglePageDragging('off')
|
||||
mag.removeClass('unanimated')
|
||||
// see which page is closer to the middle of the screen and set it...
|
||||
// do this based on how much we dragged...
|
||||
var p = Math.ceil((distance/scale)/cur.width())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user