mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-17 16:51:40 +00:00
added doc generator compatibility for action keyboard wrappers...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
c26e360145
commit
4bea6686ec
@ -376,19 +376,29 @@ function getKeyHandlers(key, modifiers, keybindings, modes, shifted_keys, action
|
|||||||
// and letting the caller decide how to make the call
|
// and letting the caller decide how to make the call
|
||||||
// seems more logical...
|
// seems more logical...
|
||||||
handler = function(n){
|
handler = function(n){
|
||||||
return function(){
|
var f = function(){ return actions[n]() }
|
||||||
return actions[n]() }}(handler)
|
// make this doc-generator compatible -- inherit all
|
||||||
|
// the docs from the actual action...
|
||||||
|
f.__proto__ = actions[n]
|
||||||
|
return f
|
||||||
|
}(handler)
|
||||||
|
|
||||||
// action name with '!' -- prevent default...
|
// action name with '!' -- prevent default...
|
||||||
} else if(handler.slice(-1) == '!'
|
} else if(handler.slice(-1) == '!'
|
||||||
&& handler.slice(0, -1) in actions){
|
&& handler.slice(0, -1) in actions){
|
||||||
// build a handler...
|
// build a handler...
|
||||||
// ...see notes for the previous section...
|
// ...for the reasons why this is like it is see notes
|
||||||
|
// for the previous if...
|
||||||
handler = function(n){
|
handler = function(n){
|
||||||
return function(){
|
var f = function(){
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
return actions[n]()
|
return actions[n]()
|
||||||
}}(handler.slice(0, -1))
|
}
|
||||||
|
// make this doc-generator compatible -- inherit all
|
||||||
|
// the docs from the actual action...
|
||||||
|
f.__proto__ = actions[n]
|
||||||
|
return f
|
||||||
|
}(handler.slice(0, -1))
|
||||||
|
|
||||||
// key code...
|
// key code...
|
||||||
} else if(typeof(handler) == typeof(1)) {
|
} else if(typeof(handler) == typeof(1)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user