@nakedcreativity/cee-ms-node 0.3.7 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cee-ms-min.js +1 -0
- package/index.js +5 -1
- package/package.json +1 -1
package/cee-ms-min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){function e(){$("[data-module-id]").each(function(e,t){$(t).hover(function(e){window.parent.postMessage({offset:$(e.currentTarget).offset(),id:$(e.currentTarget).attr("data-module-id"),height:$(e.currentTarget).outerHeight(),width:$(e.currentTarget).outerWidth(),scroll:window.scroll()},"*")})})}window.parent.postMessage({message:"domReady"},"*"),e(),window.addEventListener("message",function(t){if("renderDraftHTML"==t.data.message){document.body.innerHTML=t.data.html;var n=new Event("DOMContentLoaded");window.dispatchEvent(n);var o=new Event("load");window.dispatchEvent(o);var d=new Event("foobar");window.dispatchEvent(d),e(),window.parent.postMessage({loaded:!0,height:document.documentElement.scrollHeight},"*")}},!1),window.addEventListener("resize",function(e){window.parent.postMessage({loaded:!0,height:document.documentElement.scrollHeight},"*")}),window.addEventListener("load",function(e){window.parent.postMessage({loaded:!0,height:document.documentElement.scrollHeight},"*")})}();
|
package/index.js
CHANGED
|
@@ -72,6 +72,9 @@ function ceems(config) {
|
|
|
72
72
|
if(page.path && this.match[0] == 'page.path[0]' && site.navigation[page.path[0]]){
|
|
73
73
|
console.log('navigation exists for ', this.match[0])
|
|
74
74
|
scope.push(site.navigation[page.path[0]]);
|
|
75
|
+
}else if(page.path && this.match[0] == 'page.path[1]' && site.navigation[page.path[1]]){
|
|
76
|
+
console.log('navigation exists for ', this.match[0])
|
|
77
|
+
scope.push(site.navigation[page.path[1]]);
|
|
75
78
|
}else if(site.navigation[this.match[0]]){
|
|
76
79
|
scope.push(site.navigation[this.match[0]]);
|
|
77
80
|
}else {
|
|
@@ -290,7 +293,8 @@ ceems.prototype.render = function(req, res, page=null) {
|
|
|
290
293
|
|
|
291
294
|
console.log('render finished page')
|
|
292
295
|
var scope = page
|
|
293
|
-
|
|
296
|
+
if(this.site && this.site.navigation)
|
|
297
|
+
scope.navigation = this.site.navigation
|
|
294
298
|
|
|
295
299
|
//console.log(scope)
|
|
296
300
|
res.render(page.template, scope, function(err, html){
|