mirror of
https://github.com/flynx/actions.js.git
synced 2025-10-28 09:50:10 +00:00
now can pass the action itself to introspection function...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
2f8250d75d
commit
78a47e91ac
32
actions.js
32
actions.js
@ -1007,6 +1007,9 @@ module.MetaActions = {
|
||||
// XXX add option to to enable/disable look in .__actioncall__...
|
||||
getActionAttr: function(action, attr){
|
||||
var cur = this
|
||||
action = typeof(action) == 'function' ?
|
||||
action.name
|
||||
: action
|
||||
|
||||
// go up the proto chain...
|
||||
while(cur.__proto__ != null){
|
||||
@ -1042,6 +1045,9 @@ module.MetaActions = {
|
||||
// base Action object is checked (Action.prototype.await)...
|
||||
getRootActionAttr: function(action, attr){
|
||||
var cur = this
|
||||
action = typeof(action) == 'function' ?
|
||||
action.name
|
||||
: action
|
||||
|
||||
// go up the proto chain...
|
||||
while(cur.__proto__ != null){
|
||||
@ -1074,14 +1080,21 @@ module.MetaActions = {
|
||||
getDoc: function(actions){
|
||||
var res = {}
|
||||
var that = this
|
||||
actions = actions == null ? this.actions
|
||||
: arguments.length > 1 ? [...arguments]
|
||||
: typeof(actions) == typeof('str') ? [actions]
|
||||
actions = actions == null ?
|
||||
this.actions
|
||||
: arguments.length > 1 ?
|
||||
[...arguments]
|
||||
: (typeof(actions) == typeof('str')
|
||||
|| typeof(actions) == 'function') ?
|
||||
[actions]
|
||||
: actions
|
||||
|
||||
// get the first defined set of docs in the inheritance chain...
|
||||
actions.forEach(function(n){
|
||||
var cur = that
|
||||
n = typeof(n) == 'function' ?
|
||||
n.name
|
||||
: n
|
||||
res[n] = []
|
||||
// go up the proto chain...
|
||||
while(cur.__proto__ != null){
|
||||
@ -1094,14 +1107,21 @@ module.MetaActions = {
|
||||
getPath: function(actions){
|
||||
var res = {}
|
||||
var that = this
|
||||
actions = actions == null ? this.actions
|
||||
: arguments.length > 1 ? [...arguments]
|
||||
: typeof(actions) == typeof('str') ? [actions]
|
||||
actions = actions == null ?
|
||||
this.actions
|
||||
: arguments.length > 1 ?
|
||||
[...arguments]
|
||||
: (typeof(actions) == typeof('str')
|
||||
|| typeof(actions) == 'function') ?
|
||||
[actions]
|
||||
: actions
|
||||
|
||||
// get the first defined set of docs in the inheritance chain...
|
||||
actions.forEach(function(n){
|
||||
var cur = that
|
||||
n = typeof(n) == 'function' ?
|
||||
n.name
|
||||
: n
|
||||
// go up the proto chain...
|
||||
while(cur.__proto__ != null){
|
||||
if(cur[n] != null && cur[n].doc != null){
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-actions",
|
||||
"version": "3.24.21",
|
||||
"version": "3.24.22",
|
||||
"description": "",
|
||||
"main": "actions.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user