mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-30 19:00:09 +00:00 
			
		
		
		
	now Enter works correctly on buttons in dialogs -- pressing the button (was: accept dialog ignoring the button)...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									9b816ec553
								
							
						
					
					
						commit
						a8d9d0ebd8
					
				| @ -47,12 +47,16 @@ if(window.CEF_dumpJSON != null){ | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	window.osPath = function(p){ | 	window.osPath = function(p){ | ||||||
| 		return path.normalize(p.replace(/file:\/\/\//, '')) | 		return path | ||||||
|  | 			.normalize(p.replace(/file:\/\/\//, '')) | ||||||
|  | 	} | ||||||
|  | 	window.execPathPush = function(p){ | ||||||
|  | 		process.env.PATH += ';' + path.normalize(process.cwd() + '/' + p) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	// paths to included utils...
 | 	// paths to included utils...
 | ||||||
| 	process.env.PATH += ';' + path.normalize(process.cwd() + '/vips/bin') | 	execPathPush('./vips/bin') | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 	// Things ImageGrid needs...
 | 	// Things ImageGrid needs...
 | ||||||
|  | |||||||
| @ -80,8 +80,16 @@ var KEYBOARD_CONFIG = { | |||||||
| 
 | 
 | ||||||
| 		Enter: doc('Accept dialog', | 		Enter: doc('Accept dialog', | ||||||
| 			function(){ | 			function(){ | ||||||
|  | 				var f = $(':focus') | ||||||
|  | 				// trigger the default button action...
 | ||||||
|  | 				if(/button/i.test(f[0].tagName) || f.attr('type') == 'button'){ | ||||||
|  | 					return true | ||||||
|  | 
 | ||||||
|  | 				// accept the dialog...
 | ||||||
|  | 				} else { | ||||||
| 					getOverlay($('.viewer')).trigger('accept') | 					getOverlay($('.viewer')).trigger('accept') | ||||||
| 					hideOverlay($('.viewer'))  | 					hideOverlay($('.viewer'))  | ||||||
|  | 				} | ||||||
| 			}), | 			}), | ||||||
| 		Esc: doc('Close dialog',  | 		Esc: doc('Close dialog',  | ||||||
| 			function(){  | 			function(){  | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user