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:
Alex A. Naanou 2013-07-14 04:45:56 +04:00
parent 9b816ec553
commit a8d9d0ebd8
2 changed files with 16 additions and 4 deletions

View File

@ -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...

View File

@ -80,8 +80,16 @@ var KEYBOARD_CONFIG = {
Enter: doc('Accept dialog', Enter: doc('Accept dialog',
function(){ function(){
getOverlay($('.viewer')).trigger('accept') var f = $(':focus')
hideOverlay($('.viewer')) // 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')
hideOverlay($('.viewer'))
}
}), }),
Esc: doc('Close dialog', Esc: doc('Close dialog',
function(){ function(){