mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 11:50:07 +00:00
added option for keyboard handler to ignore what the actual actions return...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
8082695cb4
commit
3e861147e7
@ -932,8 +932,10 @@ function handleImageClick(){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
// if set to false the event handlers will always return false...
|
||||||
* Basic key format:
|
var KEYBOARD_HANDLER_PROPAGATE = false
|
||||||
|
|
||||||
|
/* Basic key format:
|
||||||
* <key-code> : <callback>,
|
* <key-code> : <callback>,
|
||||||
* <key-code> : {
|
* <key-code> : {
|
||||||
* 'default': <callback>,
|
* 'default': <callback>,
|
||||||
@ -991,13 +993,12 @@ function makeKeyboardHandler(keybindings, unhandled){
|
|||||||
}
|
}
|
||||||
if(callback != null){
|
if(callback != null){
|
||||||
var res = callback()
|
var res = callback()
|
||||||
return res?true:false
|
return KEYBOARD_HANDLER_PROPAGATE&&res?true:false
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// simple callback...
|
// simple callback...
|
||||||
var res = handler()
|
var res = handler()
|
||||||
return res?true:false
|
return KEYBOARD_HANDLER_PROPAGATE&&res?true:false
|
||||||
}
|
}
|
||||||
return unhandled(key)
|
return unhandled(key)
|
||||||
}
|
}
|
||||||
@ -1481,7 +1482,7 @@ ImageGrid.GROUP('Ribbon manipulations',
|
|||||||
// XXX adding a ribbon above the current is still jumpy, need to devise
|
// XXX adding a ribbon above the current is still jumpy, need to devise
|
||||||
// a cleaner way to do this...
|
// a cleaner way to do this...
|
||||||
ImageGrid.ACTION({
|
ImageGrid.ACTION({
|
||||||
title: 'Create a ribbon above/below current'
|
title: 'Create a ribbon above/below current',
|
||||||
display: false,
|
display: false,
|
||||||
},
|
},
|
||||||
function createRibbon(direction){
|
function createRibbon(direction){
|
||||||
@ -1519,7 +1520,7 @@ ImageGrid.GROUP('Ribbon manipulations',
|
|||||||
ImageGrid.ACTION({
|
ImageGrid.ACTION({
|
||||||
title: 'Merge current and direction ribbon.',
|
title: 'Merge current and direction ribbon.',
|
||||||
doc: 'NOTE: this will take all the elements from direction '+
|
doc: 'NOTE: this will take all the elements from direction '+
|
||||||
'ribbon and add them to current.'
|
'ribbon and add them to current.',
|
||||||
display: false,
|
display: false,
|
||||||
},
|
},
|
||||||
function mergeRibbons(direction, get_order){
|
function mergeRibbons(direction, get_order){
|
||||||
@ -1634,7 +1635,7 @@ ImageGrid.GROUP('Image manipulation',
|
|||||||
// sorting...
|
// sorting...
|
||||||
ImageGrid.ACTION({
|
ImageGrid.ACTION({
|
||||||
title: 'Sort images via a different criteria',
|
title: 'Sort images via a different criteria',
|
||||||
doc: 'use the cmp function to update image id\'s and resort.'
|
doc: 'use the cmp function to update image id\'s and resort.',
|
||||||
display: false,
|
display: false,
|
||||||
},
|
},
|
||||||
function sortImagesVia(cmp){
|
function sortImagesVia(cmp){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user