added single image kyeboard bindings...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-04-03 00:58:49 +03:00
parent 436fd80440
commit 34566ed62b
2 changed files with 20 additions and 0 deletions

View File

@ -25,6 +25,7 @@ module.GLOBAL_KEYBOARD = {
'Slideshow': {
pattern: '.slideshow-running',
ignore: [
'Esc',
'Up', 'Down', 'Enter',
'R', 'L',
],
@ -41,6 +42,21 @@ module.GLOBAL_KEYBOARD = {
L: 'toggleSlideshowLooping',
},
'Single Image': {
pattern: '.single-image-mode',
ignore: [
'Esc',
// do not crop in single image mode...
'C', 'F2',
// XXX not sure about this...
//'Up', 'Down',
],
Esc: 'toggleSingleImage: "off"',
},
'Global': {
doc: 'NOTE: binding priority is the same as the order of sections '+
'on this page.',
@ -243,8 +259,10 @@ module.GLOBAL_KEYBOARD = {
}
/*********************************************************************/
// XXX add introspection and doc actions...
var KeyboardActions = actions.Actions({
config: {
// limit key repeat to one per N milliseconds.

View File

@ -85,6 +85,8 @@ var core = require('features/core')
//
//
// XXX should this be an action???
// XXX problems:
// Q: what do we use for scale??
function updateImageProportions(){
var viewer = this.ribbons.viewer
var image = viewer.find('.image')