diff options
-rwxr-xr-x | js/data/menu-data.js | 16 | ||||
-rwxr-xr-x | js/document/document-html.js | 26 |
2 files changed, 18 insertions, 24 deletions
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, { | |||
22 | "displayText" : "New File", | 22 | "displayText" : "New File", |
23 | "hasSubMenu" : false, | 23 | "hasSubMenu" : false, |
24 | "enabled": true, | 24 | "enabled": true, |
25 | "action": "executeNewFile" | 25 | "action": "executeNewWebpage" |
26 | }, | 26 | }, |
27 | { | 27 | { |
28 | "displayText" : "Open File", | 28 | "displayText" : "Open File", |
29 | "hasSubMenu" : false, | 29 | "hasSubMenu" : false, |
30 | "enabled": true, | 30 | "enabled": true, |
31 | "action": "executeFileOpen" | 31 | "action": "executeWebpageOpen" |
32 | }, | 32 | }, |
33 | { | 33 | { |
34 | "displayText" : "Close File", | 34 | "displayText" : "Close File", |
@@ -130,18 +130,6 @@ exports.MenuData = Montage.create( Montage, { | |||
130 | { | 130 | { |
131 | "displayText" : "", | 131 | "displayText" : "", |
132 | "separator": true | 132 | "separator": true |
133 | }, | ||
134 | { | ||
135 | "displayText" : "New Webpage", | ||
136 | "hasSubMenu" : false, | ||
137 | "enabled": true, | ||
138 | "action": "executeNewWebpage" | ||
139 | }, | ||
140 | { | ||
141 | "displayText" : "Open Webpage", | ||
142 | "hasSubMenu" : false, | ||
143 | "enabled": true, | ||
144 | "action": "executeWebpageOpen" | ||
145 | } | 133 | } |
146 | ] | 134 | ] |
147 | }, | 135 | }, |
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 | |||
@@ -23,6 +23,11 @@ exports.HtmlDocument = Montage.create(Component, { | |||
23 | model: { | 23 | model: { |
24 | value: null | 24 | value: null |
25 | }, | 25 | }, |
26 | //////////////////////////////////////////////////////////////////// | ||
27 | // | ||
28 | loaded: { | ||
29 | value: {callback: null, context: null} | ||
30 | }, | ||
26 | //////////////////////////////////////////////////////////////////// | 31 | //////////////////////////////////////////////////////////////////// |
27 | // | 32 | // |
28 | _document: { | 33 | _document: { |
@@ -54,6 +59,9 @@ exports.HtmlDocument = Montage.create(Component, { | |||
54 | // | 59 | // |
55 | init: { | 60 | init: { |
56 | value:function(file, context, callback, view) { | 61 | value:function(file, context, callback, view) { |
62 | // | ||
63 | this.loaded.callback = callback; | ||
64 | this.loaded.context = context; | ||
57 | //Creating instance of HTML Document Model | 65 | //Creating instance of HTML Document Model |
58 | this.model = Montage.create(HtmlDocumentModel,{ | 66 | this.model = Montage.create(HtmlDocumentModel,{ |
59 | file: {value: file}, | 67 | file: {value: file}, |
@@ -74,8 +82,7 @@ exports.HtmlDocument = Montage.create(Component, { | |||
74 | this.model.views.design.content = this.model.file.content; | 82 | this.model.views.design.content = this.model.file.content; |
75 | // | 83 | // |
76 | this.model.views.design.render(function () { | 84 | this.model.views.design.render(function () { |
77 | //Setting opacity to be viewable after load | 85 | |
78 | this.model.views.design.iframe.style.opacity = 1; | ||
79 | 86 | ||
80 | 87 | ||
81 | 88 | ||
@@ -84,19 +91,18 @@ exports.HtmlDocument = Montage.create(Component, { | |||
84 | this._document = this.model.views.design.document; | 91 | this._document = this.model.views.design.document; |
85 | //TODO: Check for needed | 92 | //TODO: Check for needed |
86 | this.documentRoot = this.model.views.design.document.body; | 93 | this.documentRoot = this.model.views.design.document.body; |
87 | // | 94 | //TODO: Why is this needed? |
88 | this._liveNodeList = this.documentRoot.getElementsByTagName('*'); | 95 | this._liveNodeList = this.documentRoot.getElementsByTagName('*'); |
89 | // | 96 | // |
90 | document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); | 97 | document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); |
91 | 98 | //TODO: Figure out why timeout is needed | |
92 | |||
93 | |||
94 | |||
95 | this.hack = {callback: callback, context: context}; | ||
96 | |||
97 | setTimeout(function () { | 99 | setTimeout(function () { |
98 | //Making callback after view is loaded | 100 | //Making callback after view is loaded |
99 | this.hack.callback.call(this.hack.context, this); | 101 | this.loaded.callback.call(this.loaded.context, this); |
102 | //Setting opacity to be viewable after load | ||
103 | setTimeout(function () { | ||
104 | this.model.views.design.iframe.style.opacity = 1; | ||
105 | }.bind(this), 1000); | ||
100 | }.bind(this), 1000); | 106 | }.bind(this), 1000); |
101 | 107 | ||
102 | 108 | ||