From d0af21d80441cb7ffe3a92ed00f8dc9b90867098 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 23 Apr 2012 13:41:16 -0700 Subject: adjusting the bread crumb to work with the new template Initial container get setup in ninja now. Signed-off-by: Valerio Virgillito --- .../layout/bread-crumb.reel/bread-crumb.js | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'js/components/layout') diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js index f35972b6..597577f1 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.js +++ b/js/components/layout/bread-crumb.reel/bread-crumb.js @@ -63,16 +63,27 @@ exports.Breadcrumb = Montage.create(Component, { parentNode = this.container; - while(parentNode.id !== "UserContent") { + // This is for the old template support. + // TODO: Remove marker for old template: NINJA-STAGE-REWORK + if(this.application.ninja.currentDocument.documentRoot.id === "UserContent") { + while(parentNode.id !== "UserContent") { + this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); + parentNode = parentNode.parentNode; + } + + // This is always the top container which is now hardcoded to body + this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"}); + } else { + while(parentNode !== this.application.ninja.currentDocument.documentRoot) { + this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); + parentNode = parentNode.parentNode; + } + + // This is always the top container which is now hardcoded to body this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); - parentNode = parentNode.parentNode; + console.log("this works!"); } - // This is always the top container which is now hardcoded to body - this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": "Body"}); - - - } }, -- cgit v1.2.3