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 --- js/document/document-html.js | 8 ++++---- js/document/html-document.js | 2 +- js/document/templates/montage-web/main.reel/main.js | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'js/document') diff --git a/js/document/document-html.js b/js/document/document-html.js index 841e66ed..8cb88516 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -67,8 +67,8 @@ exports.HtmlDocument = Montage.create(Component, { // this.init(file.name, file.uri, file.extension, iframe, uuid, callback); + this.iframe = this.createView(); - this.iframe.addEventListener("load", this.handleWebTemplateLoad.bind(this), true); //this.selectionExclude = ["HTML", "BODY", "Viewport", "UserContent", "stageBG"]; //this.currentView = "design"; @@ -96,6 +96,7 @@ exports.HtmlDocument = Montage.create(Component, { // ifr.style.opacity = 0; ifr.src = "js/document/templates/montage-web/index.html"; + ifr.addEventListener("load", this.handleWebTemplateLoad.bind(this), true); return document.getElementById("iframeContainer").appendChild(ifr); } @@ -124,8 +125,7 @@ exports.HtmlDocument = Montage.create(Component, { // TODO: We don't need this anymore -> need to setup the main container still //Adding a handler for the main user document reel to finish loading - //this._document.body.addEventListener("userTemplateDidLoad", this.userTemplateDidLoad.bind(this), false); - this.documentRoot.addEventListener("userTemplateDidLoad", this.userTemplateDidLoad.bind(this), false); +// this.documentRoot.addEventListener("userTemplateDidLoad", this.userTemplateDidLoad.bind(this), false); // Live node list of the current loaded document this._liveNodeList = this.documentRoot.getElementsByTagName('*'); @@ -314,7 +314,7 @@ exports.HtmlDocument = Montage.create(Component, { // Setting up the currentSelectedContainer to the document body. userTemplateDidLoad: { value: function(){ - this.application.ninja.currentSelectedContainer = this.documentRoot; +// this.application.ninja.currentSelectedContainer = this.documentRoot; } } }); diff --git a/js/document/html-document.js b/js/document/html-document.js index 9873fdd1..54db9eaa 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -826,7 +826,7 @@ exports.HTMLDocument = Montage.create(TextDocument, { // Setting up the currentSelectedContainer to the document body. userTemplateDidLoad: { value: function(){ - this.application.ninja.currentSelectedContainer = this.documentRoot; + //this.application.ninja.currentSelectedContainer = this.documentRoot; } }, diff --git a/js/document/templates/montage-web/main.reel/main.js b/js/document/templates/montage-web/main.reel/main.js index 019c675e..d5ac88d5 100644 --- a/js/document/templates/montage-web/main.reel/main.js +++ b/js/document/templates/montage-web/main.reel/main.js @@ -38,10 +38,11 @@ exports.Main = Montage.create(Component, { }; // Dispatch event when this template has loaded. + /* var newEvent = document.createEvent( "CustomEvent" ); newEvent.initCustomEvent( "userTemplateDidLoad", false, true ); - document.body.dispatchEvent( newEvent ); + */ } } -- cgit v1.2.3