From 47218d0aeb4d8b519a75a62a9b42ae9d19bb790a Mon Sep 17 00:00:00 2001 From: Drew Folta Date: Tue, 2 Apr 2013 10:14:58 -0700 Subject: [PATCH] use page object to store/use staticAppConfig --- lib/app/autoload/action-context.common.js | 2 +- lib/app/autoload/mojito-client.client.js | 3 +++ lib/mojito.js | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/app/autoload/action-context.common.js b/lib/app/autoload/action-context.common.js index a1b790cfb..12da10d79 100644 --- a/lib/app/autoload/action-context.common.js +++ b/lib/app/autoload/action-context.common.js @@ -308,7 +308,7 @@ YUI.add('mojito-action-context', function(Y, NAME) { this._adapter = opts.adapter; // pathToRoot, viewEngine, amoung others will be available through this. - this.staticAppConfig = store.getStaticAppConfig(); + this.staticAppConfig = (this._adapter.page && this._adapter.page.staticAppConfig) || store.getStaticAppConfig(); // Create a function which will properly delegate to the dispatcher to // perform the actual processing. diff --git a/lib/app/autoload/mojito-client.client.js b/lib/app/autoload/mojito-client.client.js index 6098e26c8..b00db484c 100644 --- a/lib/app/autoload/mojito-client.client.js +++ b/lib/app/autoload/mojito-client.client.js @@ -338,6 +338,9 @@ YUI.add('mojito-client', function(Y, NAME) { // pass globalHookhandler to addons that may want to use hooks globalHookHandler: globalHookHandler }; + + this.page.staticAppConfig = config.appConfig; + fireLifecycle('pre-init', forwardConfig); // if we didn't originaly have hooks enabled, copy back from config object. // This is the case where an add-on module wants to turn on hooks and diff --git a/lib/mojito.js b/lib/mojito.js index 1aa716f93..adc025aed 100644 --- a/lib/mojito.js +++ b/lib/mojito.js @@ -340,6 +340,8 @@ MojitoServer.prototype._configureAppInstance = function(app, options) { log: Y.log }); + outputHandler.page.staticAppConfig = store.getStaticAppConfig(); + // HookSystem::StartBlock // enabling perf group if (appConfig.perf) {