Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
undo composite changes
Browse files Browse the repository at this point in the history
  • Loading branch information
diervo committed Nov 6, 2012
1 parent e5047e0 commit 490f76b
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions lib/app/addons/ac/composite.common.js
Expand Up @@ -19,14 +19,12 @@ YUI.add('mojito-composite-addon', function(Y, NAME) {
this.id = id;
this.callback = callback;
this.__meta = [];
this.__perf = Y.mojito.perf.timeline(NAME, 'child', 'the whole child', id);
}


AdapterBuffer.prototype = {

done: function(data, meta) {
this.__perf.done();
this.buffer[this.id].meta = meta;
this.buffer[this.id].data += data;
this.buffer.__counter__ -= 1;
Expand Down Expand Up @@ -204,8 +202,7 @@ callback({
var ac = this.ac,
buffer = {},
content = {},
meta = {},
perf;
meta = {};

cfg.children = cfg.children || {};

Expand All @@ -215,8 +212,6 @@ callback({
' array. \'children\' must be an object.');
}

perf = Y.mojito.perf.timeline(NAME, 'execute', Y.Object.keys(cfg.children).join(','), ac.command);

// check to ensure children doesn't have a null child
// in which case it will be automatically discarded to
// facilitate disabling childs based on the context.
Expand Down Expand Up @@ -255,8 +250,6 @@ callback({
ac.assets.mixAssets(meta.assets, cfg.assets);
}

perf.done();

cb(content, meta);
});
},
Expand Down Expand Up @@ -312,26 +305,16 @@ callback({
child = children[childName];
// Create a buffer for the child
buffer[childName] = {name: childName, data: '', meta: {}};

// Make a new "command" that works in the context of this
// composite
newCommand = {
instance: {
id: child.id,
action: child.action,
config: child.config || {}
},
instance: child,
// use action in child spec or default to index
action: child.action || 'index',
context: command.context,
params: child.params || command.params
};
if (child.base) {
newCommand.instance.base = child.base;
} else if (child.type) {
newCommand.instance.type = child.type;
} else {
throw new Error('No type or base founded');
}

childAdapter = new AdapterBuffer(buffer, childName,
callback);
Expand All @@ -348,7 +331,5 @@ callback({
}, '0.1.0', {requires: [
'mojito',
'mojito-util',
'mojito-perf',
'mojito-assets-addon',
'mojito-params-addon'
]});
]});

0 comments on commit 490f76b

Please sign in to comment.