mirror of
				https://github.com/flynx/PortableMag.git
				synced 2025-10-31 12:00:11 +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) | 			&& (DRAG_FULL_PAGE || !_PAGE_VIEW) | ||||||
| 			&& (direction=='left' || direction=='right')){ | 			&& (direction=='left' || direction=='right')){ | ||||||
| 		// using the "unanimated" trick we will make the drag real-time...
 | 		// using the "unanimated" trick we will make the drag real-time...
 | ||||||
| 		mag.addClass('unanimated') |  | ||||||
| 		if(direction == 'left'){ | 		if(direction == 'left'){ | ||||||
| 			mag.css({left: -n*cur.width()-distance/scale}) | 			mag.css({left: -n*cur.width()-distance/scale}) | ||||||
| 		} else if(direction == 'right') { | 		} else if(direction == 'right') { | ||||||
| 			mag.css({left: -n*cur.width()+distance/scale}) | 			mag.css({left: -n*cur.width()+distance/scale}) | ||||||
| 		} | 		} | ||||||
| 		setTimeout(function(){mag.removeClass('unanimated')}, 5) |  | ||||||
| 
 | 
 | ||||||
| 	} else if(phase == 'start') { | 	} else if(phase == 'start') { | ||||||
| 		togglePageDragging('on') | 		togglePageDragging('on') | ||||||
|  | 		mag.addClass('unanimated') | ||||||
| 
 | 
 | ||||||
| 	} else if(phase == 'cancel') { | 	} else if(phase == 'cancel') { | ||||||
| 		togglePageDragging('off') | 		togglePageDragging('off') | ||||||
| 		setCurrentPage() | 		setCurrentPage() | ||||||
|  | 		mag.removeClass('unanimated') | ||||||
| 
 | 
 | ||||||
| 	} else if(phase =='end' ) { | 	} else if(phase =='end' ) { | ||||||
| 		togglePageDragging('off') | 		togglePageDragging('off') | ||||||
|  | 		mag.removeClass('unanimated') | ||||||
| 		// see which page is closer to the middle of the screen and set it...
 | 		// see which page is closer to the middle of the screen and set it...
 | ||||||
| 		// do this based on how much we dragged...
 | 		// do this based on how much we dragged...
 | ||||||
| 		var p = Math.ceil((distance/scale)/cur.width()) | 		var p = Math.ceil((distance/scale)/cur.width()) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user