From 209f92b1bf5cd2fdde2174846f158f11280ade85 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 3 Jun 2013 18:30:54 +0400 Subject: [PATCH] fixed a bug in keyboard.js... Signed-off-by: Alex A. Naanou --- ui/TODO.otl | 12 ++++++++++++ ui/lib/keyboard.js | 8 ++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ui/TODO.otl b/ui/TODO.otl index 301c98bb..12c22eb7 100755 --- a/ui/TODO.otl +++ b/ui/TODO.otl @@ -213,6 +213,18 @@ Roadmap [_] caching config [_] BUG: BASE_URL seems to gain a new trailing '/' on each save... | low priority as this does not affect anything... + [X] BUG: keyboard.js, some combinations resolve problems... + | in current help shows E, F4, alt-F4 as "Open image in ..." + | - E and F4 work OK + | - alt-F4 both close the viewer (default) and open an image. + | + | Example: + | E: doc('Open image in external software', openImage), + | F4: { + | default: 'E', + | alt: doc('Close viewer'), + | }, + | [X] reverse ribbons... [X] slideshow mode... [X] default STUB image... diff --git a/ui/lib/keyboard.js b/ui/lib/keyboard.js index 3ac518db..0ecb6521 100755 --- a/ui/lib/keyboard.js +++ b/ui/lib/keyboard.js @@ -213,8 +213,12 @@ function getKeyHandlers(key, modifiers, keybindings, modes, shifted_keys){ if(modifiers == '?'){ break } - if(typeof(handler[modifiers]) == typeof('str')){ - handler = handler[modifiers] + if(modifiers in handler){ + if(typeof(handler[modifiers]) == typeof('str')){ + handler = handler[modifiers] + } else { + break + } } else if(typeof(handler['default']) == typeof('str')){ handler = handler['default'] } else {