mirror of
https://github.com/flynx/actions.js.git
synced 2025-10-30 02:40:10 +00:00
added action attr defaults -- resolve in .__call__ if not found in target action...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b23247f6c2
commit
46f6ec6105
15
actions.js
15
actions.js
@ -873,6 +873,13 @@ module.MetaActions = {
|
|||||||
|
|
||||||
// Get action attribute...
|
// Get action attribute...
|
||||||
//
|
//
|
||||||
|
// Attribute search order (return first matching):
|
||||||
|
// - Local action
|
||||||
|
// - Local action.function (.func)
|
||||||
|
// - repeat for .__proto__ (until top of MRO)
|
||||||
|
// - repeat for '__call__' special action (XXX EXPERIMENTAL)
|
||||||
|
//
|
||||||
|
//
|
||||||
// NOTE: this will get attribute set both on the action object and
|
// NOTE: this will get attribute set both on the action object and
|
||||||
// the action function, this covers two usecases:
|
// the action function, this covers two usecases:
|
||||||
// 1) action constructor attributes...
|
// 1) action constructor attributes...
|
||||||
@ -889,6 +896,9 @@ module.MetaActions = {
|
|||||||
// ...
|
// ...
|
||||||
// someAction: ['...',
|
// someAction: ['...',
|
||||||
// modifyAction(function(){ ... })],
|
// modifyAction(function(){ ... })],
|
||||||
|
//
|
||||||
|
// XXX document...
|
||||||
|
// XXX add option to to enable/disable look in .__call__...
|
||||||
getActionAttr: function(action, attr){
|
getActionAttr: function(action, attr){
|
||||||
var cur = this
|
var cur = this
|
||||||
|
|
||||||
@ -906,6 +916,11 @@ module.MetaActions = {
|
|||||||
}
|
}
|
||||||
cur = cur.__proto__
|
cur = cur.__proto__
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// search .__call__ action...
|
||||||
|
if(action != '__call__'){
|
||||||
|
return this.getActionAttr('__call__', attr)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Get action documentation...
|
// Get action documentation...
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ig-actions",
|
"name": "ig-actions",
|
||||||
"version": "3.5.5",
|
"version": "3.6.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "actions.js",
|
"main": "actions.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user