mirror of
https://github.com/flynx/actions.js.git
synced 2025-10-28 18:00:11 +00:00
added .alias(..) action...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
bb13399508
commit
c9aac1e327
22
actions.js
22
actions.js
@ -643,15 +643,18 @@ function Alias(alias, target){
|
||||
return new Alias(alias, target)
|
||||
}
|
||||
|
||||
var parsed = typeof(target) == typeof('str') ? null : target
|
||||
var doc = parsed ? parsed.doc : null
|
||||
|
||||
// XXX would be good to pre-parse the target...
|
||||
var meth = Action(alias,
|
||||
// XXX pre-parse the doc if possible...
|
||||
null, null,
|
||||
doc, null,
|
||||
{ alias: target },
|
||||
function(){
|
||||
// parse the target...
|
||||
var action = this.parseStringAction(target)
|
||||
|
||||
// XXX should we cache here???
|
||||
var action = parsed || this.parseStringAction(target)
|
||||
var args = action.arguments.slice()
|
||||
|
||||
// XXX merge args...
|
||||
@ -718,6 +721,16 @@ module.MetaActions = {
|
||||
parseStringAction: parseStringAction,
|
||||
|
||||
|
||||
// XXX should this prevent overriding stuff???
|
||||
// XXX move to a better spot...
|
||||
alias: Action('alias', function(alias, target){
|
||||
var parsed = typeof(target) == typeof('str') ?
|
||||
this.parseStringAction(target)
|
||||
: target
|
||||
this[alias] = Alias(alias, parsed)
|
||||
}),
|
||||
|
||||
|
||||
// Get action attribute...
|
||||
//
|
||||
// NOTE: this will get attribute set both on the action object and
|
||||
@ -1493,8 +1506,7 @@ module.MetaActions = {
|
||||
// Remove a set of local mixed in actions from object...
|
||||
//
|
||||
mixoutFrom: function(to, options){
|
||||
return this.mixout.call(to, this, options)
|
||||
},
|
||||
return this.mixout.call(to, this, options) },
|
||||
|
||||
// Create a child object...
|
||||
//
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ig-actions",
|
||||
"version": "3.3.3",
|
||||
"version": "3.3.4",
|
||||
"description": "",
|
||||
"main": "actions.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user