mirror of
				https://github.com/flynx/PortableMag.git
				synced 2025-10-31 12:00:11 +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 | [_] 29% Priority work | ||||||
| 	[_] 45% general todo | 	[_] 50% general todo | ||||||
| 		[_] populate an example issue | 		[_] populate an example issue | ||||||
| 		[_] test for stability | 		[_] test for stability | ||||||
| 		[_] cleanup code | 		[_] cleanup code | ||||||
| @ -11,6 +11,7 @@ | |||||||
| 		[_] BUG: href to existing anchors will mess up layout... | 		[_] BUG: href to existing anchors will mess up layout... | ||||||
| 		| need to find out how can we disable anchor links from actually | 		| need to find out how can we disable anchor links from actually | ||||||
| 		| going to the anchor... | 		| going to the anchor... | ||||||
|  | 		[X] added pinch events... | ||||||
| 		[X] #URL "layers" | 		[X] #URL "layers" | ||||||
| 		| navigation to a hidden layer will show the layer, any other  | 		| navigation to a hidden layer will show the layer, any other  | ||||||
| 		| navigation will hide it... | 		| 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 pages = $('.page') | ||||||
| 	var cur = $('.current.page') | 	var cur = $('.current.page') | ||||||
| 	var n = pages.index(cur) | 	var n = pages.index(cur) | ||||||
| @ -345,12 +345,22 @@ function swipeUpdate(evt, phase, direction, distance){ | |||||||
| 
 | 
 | ||||||
| 		// prev page...
 | 		// prev page...
 | ||||||
| 		if(direction == 'right') { | 		if(direction == 'right') { | ||||||
|  | 			// two+ fingers moves to closest article...
 | ||||||
|  | 			if(fingers >= 2){ | ||||||
|  | 				prevArticle() | ||||||
|  | 			} else { | ||||||
| 				setCurrentPage(Math.max(n-p, 0)) | 				setCurrentPage(Math.max(n-p, 0)) | ||||||
|  | 			} | ||||||
| 		// next page...
 | 		// next page...
 | ||||||
| 		} else if (direction == 'left'){ | 		} else if (direction == 'left'){ | ||||||
|  | 			// two+ fingers moves to closest article...
 | ||||||
|  | 			if(fingers >= 2){ | ||||||
|  | 				nextArticle() | ||||||
|  | 			} else { | ||||||
| 				setCurrentPage(Math.min(n+p, pages.length-1)) | 				setCurrentPage(Math.min(n+p, pages.length-1)) | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|  | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user