From f0995f1676f460d34dcc767b94f3c96380a5375d Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 15 Feb 2018 06:10:50 +0300 Subject: [PATCH] now docs can be set directly on the action function... Signed-off-by: Alex A. Naanou --- actions.js | 9 +++++++-- package.json | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/actions.js b/actions.js index bc569f5..fa7e8f5 100755 --- a/actions.js +++ b/actions.js @@ -499,6 +499,7 @@ parseStringAction.callAction = function(context, action, ...args){ return context[action.action] instanceof Function ? context[action.action] .apply(context, this.resolveArgs(context, action.arguments, args)) + // action not found or is not callable... (XXX) : undefined } parseStringAction.applyAction = function(context, action, args){ @@ -628,8 +629,12 @@ function Action(name, doc, ldoc, attrs, func){ func = args.pop() last = args[args.length-1] attrs = last != null && typeof(last) != typeof('str') ? args.pop() : {} - doc = typeof(args[0]) == typeof('str') ? args.shift() : null - ldoc = typeof(args[0]) == typeof('str') ? args.shift() : null + doc = typeof(args[0]) == typeof('str') ? args.shift() + : func.doc ? func.doc + : null + ldoc = typeof(args[0]) == typeof('str') ? args.shift() + : func.long_doc ? func.long_doc + : null // populate the action attributes... //meth.name = name diff --git a/package.json b/package.json index 4af8ba9..c1a92fc 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-actions", - "version": "3.15.0", + "version": "3.16.0", "description": "", "main": "actions.js", "scripts": {