From 490f76b50f40c3b7f6f50b323eb19c11e5a6e0b6 Mon Sep 17 00:00:00 2001 From: Diego FV Date: Tue, 6 Nov 2012 14:39:36 -0800 Subject: [PATCH] undo composite changes --- lib/app/addons/ac/composite.common.js | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/lib/app/addons/ac/composite.common.js b/lib/app/addons/ac/composite.common.js index 511ebd18a..23b69e307 100644 --- a/lib/app/addons/ac/composite.common.js +++ b/lib/app/addons/ac/composite.common.js @@ -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; @@ -204,8 +202,7 @@ callback({ var ac = this.ac, buffer = {}, content = {}, - meta = {}, - perf; + meta = {}; cfg.children = cfg.children || {}; @@ -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. @@ -255,8 +250,6 @@ callback({ ac.assets.mixAssets(meta.assets, cfg.assets); } - perf.done(); - cb(content, meta); }); }, @@ -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); @@ -348,7 +331,5 @@ callback({ }, '0.1.0', {requires: [ 'mojito', 'mojito-util', - 'mojito-perf', - 'mojito-assets-addon', 'mojito-params-addon' -]}); +]}); \ No newline at end of file