mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
monor addition...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6fc5ab2dad
commit
4eda181d1c
@ -381,11 +381,19 @@ var KeyboardHandlerPrototype = {
|
|||||||
// get keys for handler...
|
// get keys for handler...
|
||||||
//
|
//
|
||||||
// NOTE: this will also return non-key aliases...
|
// NOTE: this will also return non-key aliases...
|
||||||
|
// NOTE: to match several compatible handlers, pass a list of handlers,
|
||||||
|
// the result for each will be merged into one common list.
|
||||||
|
//
|
||||||
|
// XXX passing a list of handlers will yield a single list of kyes...
|
||||||
|
// ...should this list be split into handlers???
|
||||||
keys: function(handler){
|
keys: function(handler){
|
||||||
var that = this
|
var that = this
|
||||||
var res = {}
|
var res = {}
|
||||||
var keyboard = this.keyboard
|
var keyboard = this.keyboard
|
||||||
var key_separators = KEY_SEPARATORS
|
var key_separators = KEY_SEPARATORS
|
||||||
|
handler = arguments.length > 1 ? [].slice.call(arguments)
|
||||||
|
: handler instanceof Array ? handler
|
||||||
|
: [handler]
|
||||||
|
|
||||||
var walkAliases = function(res, rev, bindings, key, mod){
|
var walkAliases = function(res, rev, bindings, key, mod){
|
||||||
mod = mod || []
|
mod = mod || []
|
||||||
@ -412,7 +420,10 @@ var KeyboardHandlerPrototype = {
|
|||||||
rev[bindings[key]] = (rev[bindings[key]] || []).concat([key])
|
rev[bindings[key]] = (rev[bindings[key]] || []).concat([key])
|
||||||
})
|
})
|
||||||
|
|
||||||
var keys = (rev[handler] || []).map(that.normalizeKey.bind(that))
|
var keys = []
|
||||||
|
handler.forEach(function(h){
|
||||||
|
keys = keys.concat((rev[h] || []).map(that.normalizeKey.bind(that)))
|
||||||
|
})
|
||||||
|
|
||||||
// find all reachable keys from the ones we just found in reverse...
|
// find all reachable keys from the ones we just found in reverse...
|
||||||
keys.slice().forEach(function(key){
|
keys.slice().forEach(function(key){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user