From df3f96beb749951162bb60ec88363340e3ef6d95 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 1 May 2012 15:59:47 -0700 Subject: More clean up, updating menu items --- js/data/menu-data.js | 16 ++-------------- js/document/document-html.js | 26 ++++++++++++++++---------- 2 files changed, 18 insertions(+), 24 deletions(-) (limited to 'js') diff --git a/js/data/menu-data.js b/js/data/menu-data.js index 9e8bf945..1cde3e8d 100755 --- a/js/data/menu-data.js +++ b/js/data/menu-data.js @@ -22,13 +22,13 @@ exports.MenuData = Montage.create( Montage, { "displayText" : "New File", "hasSubMenu" : false, "enabled": true, - "action": "executeNewFile" + "action": "executeNewWebpage" }, { "displayText" : "Open File", "hasSubMenu" : false, "enabled": true, - "action": "executeFileOpen" + "action": "executeWebpageOpen" }, { "displayText" : "Close File", @@ -130,18 +130,6 @@ exports.MenuData = Montage.create( Montage, { { "displayText" : "", "separator": true - }, - { - "displayText" : "New Webpage", - "hasSubMenu" : false, - "enabled": true, - "action": "executeNewWebpage" - }, - { - "displayText" : "Open Webpage", - "hasSubMenu" : false, - "enabled": true, - "action": "executeWebpageOpen" } ] }, diff --git a/js/document/document-html.js b/js/document/document-html.js index ad82c371..6ace440f 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -22,6 +22,11 @@ exports.HtmlDocument = Montage.create(Component, { // model: { value: null + }, + //////////////////////////////////////////////////////////////////// + // + loaded: { + value: {callback: null, context: null} }, //////////////////////////////////////////////////////////////////// // @@ -54,6 +59,9 @@ exports.HtmlDocument = Montage.create(Component, { // init: { value:function(file, context, callback, view) { + // + this.loaded.callback = callback; + this.loaded.context = context; //Creating instance of HTML Document Model this.model = Montage.create(HtmlDocumentModel,{ file: {value: file}, @@ -74,8 +82,7 @@ exports.HtmlDocument = Montage.create(Component, { this.model.views.design.content = this.model.file.content; // this.model.views.design.render(function () { - //Setting opacity to be viewable after load - this.model.views.design.iframe.style.opacity = 1; + @@ -84,19 +91,18 @@ exports.HtmlDocument = Montage.create(Component, { this._document = this.model.views.design.document; //TODO: Check for needed this.documentRoot = this.model.views.design.document.body; - // + //TODO: Why is this needed? this._liveNodeList = this.documentRoot.getElementsByTagName('*'); // document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); - - - - - this.hack = {callback: callback, context: context}; - + //TODO: Figure out why timeout is needed setTimeout(function () { //Making callback after view is loaded - this.hack.callback.call(this.hack.context, this); + this.loaded.callback.call(this.loaded.context, this); + //Setting opacity to be viewable after load + setTimeout(function () { + this.model.views.design.iframe.style.opacity = 1; + }.bind(this), 1000); }.bind(this), 1000); -- cgit v1.2.3