mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 11:20:09 +00:00 
			
		
		
		
	minor refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									ecf8a762ff
								
							
						
					
					
						commit
						0b3ad6d5b4
					
				| @ -51,8 +51,7 @@ function setup(){ | |||||||
| 	setBackgroundMode('dark') | 	setBackgroundMode('dark') | ||||||
| 
 | 
 | ||||||
| 	// setup event handlers... | 	// setup event handlers... | ||||||
| 	setupKeyboard() | 	setupEvents() | ||||||
| 	setupGestures() |  | ||||||
| 	setupControlElements() | 	setupControlElements() | ||||||
| 
 | 
 | ||||||
| 	// XXX | 	// XXX | ||||||
|  | |||||||
| @ -76,23 +76,19 @@ function setDefaultInitialState(){ | |||||||
| 	if($('.current.image').length == 0){ | 	if($('.current.image').length == 0){ | ||||||
| 		$('.current.ribbon').children('.image').first().addClass('current') | 		$('.current.ribbon').children('.image').first().addClass('current') | ||||||
| 	} | 	} | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | function setupEvents(){ | ||||||
|  | 	// resize...
 | ||||||
| 	$(window).resize(function() { | 	$(window).resize(function() { | ||||||
| 		// XXX HACK
 | 		// XXX HACK
 | ||||||
| 		$('.current.image').click() | 		$('.current.image').click() | ||||||
| 	}) | 	}) | ||||||
| 	 | 	// keyboard...
 | ||||||
| } |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| function setupKeyboard(){ |  | ||||||
| 	$(document) | 	$(document) | ||||||
| 		.keydown(handleKeys) | 		.keydown(handleKeys) | ||||||
| } | 	// swipe...
 | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| function setupGestures(){ |  | ||||||
| 	$('.viewer') | 	$('.viewer') | ||||||
| 		.swipe({ | 		.swipe({ | ||||||
| 			swipeLeft: nextImage, | 			swipeLeft: nextImage, | ||||||
|  | |||||||
| @ -48,8 +48,7 @@ function setup(){ | |||||||
| 	setBackgroundMode('dark') | 	setBackgroundMode('dark') | ||||||
| 
 | 
 | ||||||
| 	// setup event handlers... | 	// setup event handlers... | ||||||
| 	setupKeyboard() | 	setupEvents() | ||||||
| 	setupGestures() |  | ||||||
| 	setupControlElements() | 	setupControlElements() | ||||||
| 
 | 
 | ||||||
| 	// XXX | 	// XXX | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user