minor tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-11-23 14:55:46 +03:00
parent 26e6ace22d
commit e9775d7334
2 changed files with 5 additions and 6 deletions

View File

@ -1237,13 +1237,11 @@ module.MetaActions = {
// XXX should we have multiple tags per handler??? // XXX should we have multiple tags per handler???
on: function(actions, b, c){ on: function(actions, b, c){
var that = this var that = this
//var handler = typeof(c) == 'function' ? c : b
//var tag = typeof(c) == 'function' ? b : c
var _handler = arguments.length == 3 ? c : b var _handler = arguments.length == 3 ? c : b
var tag = arguments.length == 3 ? b : c var tag = arguments.length == 3 ? b : c
// alias handler... // alias handler...
// cache the parsed handler... // NOTE: we cache the parsed handler...
var parsed var parsed
var handler = typeof(_handler) == 'function' ? var handler = typeof(_handler) == 'function' ?
_handler _handler
@ -1261,8 +1259,9 @@ module.MetaActions = {
: console.error( : console.error(
`.on(..): Unknown handler target action: ${parsed.action}`) } `.on(..): Unknown handler target action: ${parsed.action}`) }
// XXX make this split by whitespace... actions = typeof(actions) == 'string' ?
actions = typeof(actions) == 'string' ? actions.split(/ +/) : actions actions.split(/\s+/)
: actions
actions.forEach(function(action){ actions.forEach(function(action){
// prepare the handler... // prepare the handler...

View File

@ -1,6 +1,6 @@
{ {
"name": "ig-actions", "name": "ig-actions",
"version": "3.24.12", "version": "3.24.13",
"description": "", "description": "",
"main": "actions.js", "main": "actions.js",
"scripts": { "scripts": {