fixed bug in keyboard.js...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2013-06-04 01:33:06 +04:00
parent dc01b6ea30
commit 4cf1b8e1ce
2 changed files with 8 additions and 2 deletions

View File

@ -162,6 +162,7 @@ var KEYBOARD_CONFIG = {
// ribbon mode only...
//
// XXX this breaks getKeyHandlers(...) when modes argument is given...
'.viewer:not(.overlay):not(.single-image-mode)': {
title: 'Ribbon mode',

View File

@ -179,6 +179,8 @@ function getKeyHandlers(key, modifiers, keybindings, modes, shifted_keys){
for(var mode in keybindings){
//console.log('>>>', mode)
// test for mode compatibility...
// XXX this fails for explicitly given mode...
if(modes != 'all'
@ -255,6 +257,8 @@ function getKeyHandlers(key, modifiers, keybindings, modes, shifted_keys){
continue
}
//console.log('<<<', mode, did_handling)
// complex handler...
if(typeof(handler) == typeof({}) && handler.constructor.name == 'Object'){
// build modifier list...
@ -289,7 +293,8 @@ function getKeyHandlers(key, modifiers, keybindings, modes, shifted_keys){
continue
}
if(did_handling){
if(modes != 'all' && did_handling){
//console.log('!!!!', mode)
break
}
}