mirror of
				https://github.com/flynx/PortableMag.git
				synced 2025-10-31 20:10:13 +00:00 
			
		
		
		
	added multy-finger swipes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									78566ae516
								
							
						
					
					
						commit
						f6a9da12a4
					
				
							
								
								
									
										5
									
								
								TODO.otl
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								TODO.otl
									
									
									
									
									
								
							| @ -1,5 +1,5 @@ | ||||
| [_] 27% Priority work | ||||
| 	[_] 45% general todo | ||||
| [_] 29% Priority work | ||||
| 	[_] 50% general todo | ||||
| 		[_] populate an example issue | ||||
| 		[_] test for stability | ||||
| 		[_] cleanup code | ||||
| @ -11,6 +11,7 @@ | ||||
| 		[_] BUG: href to existing anchors will mess up layout... | ||||
| 		| need to find out how can we disable anchor links from actually | ||||
| 		| going to the anchor... | ||||
| 		[X] added pinch events... | ||||
| 		[X] #URL "layers" | ||||
| 		| navigation to a hidden layer will show the layer, any other  | ||||
| 		| navigation will hide it... | ||||
|  | ||||
							
								
								
									
										12
									
								
								magazine.js
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								magazine.js
									
									
									
									
									
								
							| @ -314,7 +314,7 @@ function fitPagesToContent(n){ | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| function swipeUpdate(evt, phase, direction, distance){ | ||||
| function swipeUpdate(evt, phase, direction, distance, duration, fingers){ | ||||
| 	var pages = $('.page') | ||||
| 	var cur = $('.current.page') | ||||
| 	var n = pages.index(cur) | ||||
| @ -345,13 +345,23 @@ function swipeUpdate(evt, phase, direction, distance){ | ||||
| 
 | ||||
| 		// prev page...
 | ||||
| 		if(direction == 'right') { | ||||
| 			// two+ fingers moves to closest article...
 | ||||
| 			if(fingers >= 2){ | ||||
| 				prevArticle() | ||||
| 			} else { | ||||
| 				setCurrentPage(Math.max(n-p, 0)) | ||||
| 			} | ||||
| 		// next page...
 | ||||
| 		} else if (direction == 'left'){ | ||||
| 			// two+ fingers moves to closest article...
 | ||||
| 			if(fingers >= 2){ | ||||
| 				nextArticle() | ||||
| 			} else { | ||||
| 				setCurrentPage(Math.min(n+p, pages.length-1)) | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| function setCurrentPage(n, W){ | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user