Created
October 30, 2009 11:21
-
-
Save oberhamsi/222272 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/modules/helma/skin.js b/modules/helma/skin.js | |
index e35627b..b6e3928 100644 | |
--- a/modules/helma/skin.js | |
+++ b/modules/helma/skin.js | |
@@ -38,7 +38,7 @@ function render(skinOrResource, context, scope) { | |
} else { | |
throw Error("Unknown skin object: " + skinOrResource); | |
} | |
- return skin.render(context); | |
+ return skin.render(context, scope); | |
} | |
/** | |
@@ -105,7 +105,7 @@ function Skin(mainSkin, subSkins, parentSkin) { | |
var self = this; | |
- this.render = function render(context) { | |
+ this.render = function render(context, macroContext) { | |
// extend context by globally provided macros and filters. | |
// user-provided context overrides globally defined stuff | |
var configs = require('helma/webapp/env').configs; | |
@@ -115,7 +115,10 @@ function Skin(mainSkin, subSkins, parentSkin) { | |
context = Object.merge(context, require(module)); | |
} | |
} | |
- } | |
+ } | |
+ if (macroContext) { | |
+ context = Object.merge(context, macroContext); | |
+ } | |
if (mainSkin.length === 0 && parentSkin) { | |
return renderInternal(parentSkin.getSkinParts(), context); | |
} else { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment