mirror of
https://github.com/flynx/actions.js.git
synced 2025-10-29 10:20:09 +00:00
now docs can be set directly on the action function...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
9080ecd29c
commit
f0995f1676
@ -499,6 +499,7 @@ parseStringAction.callAction = function(context, action, ...args){
|
|||||||
return context[action.action] instanceof Function ?
|
return context[action.action] instanceof Function ?
|
||||||
context[action.action]
|
context[action.action]
|
||||||
.apply(context, this.resolveArgs(context, action.arguments, args))
|
.apply(context, this.resolveArgs(context, action.arguments, args))
|
||||||
|
// action not found or is not callable... (XXX)
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
parseStringAction.applyAction = function(context, action, args){
|
parseStringAction.applyAction = function(context, action, args){
|
||||||
@ -628,8 +629,12 @@ function Action(name, doc, ldoc, attrs, func){
|
|||||||
func = args.pop()
|
func = args.pop()
|
||||||
last = args[args.length-1]
|
last = args[args.length-1]
|
||||||
attrs = last != null && typeof(last) != typeof('str') ? args.pop() : {}
|
attrs = last != null && typeof(last) != typeof('str') ? args.pop() : {}
|
||||||
doc = typeof(args[0]) == typeof('str') ? args.shift() : null
|
doc = typeof(args[0]) == typeof('str') ? args.shift()
|
||||||
ldoc = typeof(args[0]) == typeof('str') ? args.shift() : null
|
: func.doc ? func.doc
|
||||||
|
: null
|
||||||
|
ldoc = typeof(args[0]) == typeof('str') ? args.shift()
|
||||||
|
: func.long_doc ? func.long_doc
|
||||||
|
: null
|
||||||
|
|
||||||
// populate the action attributes...
|
// populate the action attributes...
|
||||||
//meth.name = name
|
//meth.name = name
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ig-actions",
|
"name": "ig-actions",
|
||||||
"version": "3.15.0",
|
"version": "3.16.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "actions.js",
|
"main": "actions.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user