now action attr searches also look in alias targets...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-12-24 06:46:39 +03:00
parent 1166f2472c
commit 5527a57da8
2 changed files with 23 additions and 2 deletions

View File

@ -366,6 +366,17 @@ function(func){
// $N - expanded to and instance of parseStringAction.Argument
// ... - expanded to parseStringAction.ALLARGS (singleton)
//
//
// Returns:
// {
// action: action,
// arguments: args,
// doc: doc,
// no_default: no_default,
// stop_propagation: false,
//
// code: txt,
// }
//
// NOTE: identifiers are resolved as attributes of the context...
// XXX this is the same as ImageGrid's keyboard.parseActionCall(..), reuse
@ -1014,7 +1025,8 @@ module.MetaActions = {
//
// Attribute search order (return first matching):
// - Local action
// - Local action.function (.func)
// - Local action function (.func)
// - if an alias look in the target...
// - repeat for .__proto__ (until top of MRO)
// - repeat for '__call__' special action (XXX EXPERIMENTAL)
//
@ -1051,6 +1063,15 @@ module.MetaActions = {
// attribute of action function...
} else if(cur[action].func && cur[action].func[attr] !== undefined){
return cur[action].func[attr]
// alias -> look in the target action...
} else if(cur[action] instanceof Alias){
var res = this.getActionAttr(
this.parseStringAction(cur[action].alias).action,
attr)
if(res !== undefined){
return res
}
}
}
cur = cur.__proto__

View File

@ -1,6 +1,6 @@
{
"name": "ig-actions",
"version": "3.11.0",
"version": "3.12.0",
"description": "",
"main": "actions.js",
"scripts": {