Guest User

Untitled

a guest
Apr 19th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. diff --git a/modules/helma/skin.js b/modules/helma/skin.js
  2. index e35627b..b6e3928 100644
  3. --- a/modules/helma/skin.js
  4. +++ b/modules/helma/skin.js
  5. @@ -38,7 +38,7 @@ function render(skinOrResource, context, scope) {
  6. } else {
  7. throw Error("Unknown skin object: " + skinOrResource);
  8. }
  9. - return skin.render(context);
  10. + return skin.render(context, scope);
  11. }
  12.  
  13. /**
  14. @@ -105,7 +105,7 @@ function Skin(mainSkin, subSkins, parentSkin) {
  15.  
  16. var self = this;
  17.  
  18. - this.render = function render(context) {
  19. + this.render = function render(context, macroContext) {
  20. // extend context by globally provided macros and filters.
  21. // user-provided context overrides globally defined stuff
  22. var configs = require('helma/webapp/env').configs;
  23. @@ -115,7 +115,10 @@ function Skin(mainSkin, subSkins, parentSkin) {
  24. context = Object.merge(context, require(module));
  25. }
  26. }
  27. - }
  28. + }
  29. + if (macroContext) {
  30. + context = Object.merge(context, macroContext);
  31. + }
  32. if (mainSkin.length === 0 && parentSkin) {
  33. return renderInternal(parentSkin.getSkinParts(), context);
  34. } else {
Add Comment
Please, Sign In to add comment