mirror of
https://github.com/flynx/actions.js.git
synced 2025-10-28 18:00:11 +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...
|
||||
//
|
||||
// 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
|
||||
// the action function, this covers two usecases:
|
||||
// 1) action constructor attributes...
|
||||
@ -889,6 +896,9 @@ module.MetaActions = {
|
||||
// ...
|
||||
// someAction: ['...',
|
||||
// modifyAction(function(){ ... })],
|
||||
//
|
||||
// XXX document...
|
||||
// XXX add option to to enable/disable look in .__call__...
|
||||
getActionAttr: function(action, attr){
|
||||
var cur = this
|
||||
|
||||
@ -906,6 +916,11 @@ module.MetaActions = {
|
||||
}
|
||||
cur = cur.__proto__
|
||||
}
|
||||
|
||||
// search .__call__ action...
|
||||
if(action != '__call__'){
|
||||
return this.getActionAttr('__call__', attr)
|
||||
}
|
||||
},
|
||||
|
||||
// Get action documentation...
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-actions",
|
||||
"version": "3.5.5",
|
||||
"version": "3.6.0",
|
||||
"description": "",
|
||||
"main": "actions.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user