mirror of
				https://github.com/flynx/PortableMag.git
				synced 2025-10-31 12:00:11 +00:00 
			
		
		
		
	added two finger actions and migrated article nav...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									c09e069dca
								
							
						
					
					
						commit
						0bbb0aeb6b
					
				| @ -85,6 +85,11 @@ function prepareTransitions(elem){ | ||||
| } | ||||
| 
 | ||||
| $(document).ready(function(){ | ||||
| 	$(window) | ||||
| 		//.resize(viewResizeHandler) | ||||
| 		.resize(updateView) | ||||
| 		.bind('hashchange', hashChangeHandler) | ||||
| 
 | ||||
| 	// keyboard... | ||||
| 	$(document) | ||||
| 		.keydown(makeKeyboardHandler({ | ||||
|  | ||||
							
								
								
									
										15
									
								
								layout.js
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								layout.js
									
									
									
									
									
								
							| @ -94,7 +94,7 @@ function handleLongClick(evt, data){ | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| function makeSwipeHandler(action){ | ||||
| function makeSwipeHandler(actionA, actionB){ | ||||
| 	return function(evt, data){ | ||||
| 		// ribbon mode...
 | ||||
| 		if(isNavigationViewRelative()){ | ||||
| @ -112,11 +112,15 @@ function makeSwipeHandler(action){ | ||||
| 		//setTransitionEasing(mag, 'ease-out')
 | ||||
| 		setTransitionEasing(mag, 'cubic-bezier(0.33,0.66,0.66,1)') | ||||
| 
 | ||||
| 		action($('.current.page')) | ||||
| 		if(data.fingers == 2){ | ||||
| 			actionA($('.current.page')) | ||||
| 		} else { | ||||
| 			actionA($('.current.page')) | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| var handleSwipeLeft = makeSwipeHandler(prevPage) | ||||
| var handleSwipeRight = makeSwipeHandler(nextPage) | ||||
| var handleSwipeLeft = makeSwipeHandler(prevPage, prevArticle) | ||||
| var handleSwipeRight = makeSwipeHandler(nextPage, nextArticle) | ||||
| 
 | ||||
| // do snap and innertia...
 | ||||
| // NOTE: this will also handle swipeUp/swopeDown as we do not 
 | ||||
| @ -312,6 +316,9 @@ function setCurrentPage(n){ | ||||
| 	if(n == null){ | ||||
| 		n = getPageNumber() | ||||
| 	} | ||||
| 	if(typeof(n) != typeof(3)){ | ||||
| 		n = getPageNumber(n) | ||||
| 	} | ||||
| 	var l = $('.page').length | ||||
| 	// normalize the number...
 | ||||
| 	n = n < 0 ? l - n : n | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user