aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/stage-view.reel/stage-view.js50
1 files changed, 17 insertions, 33 deletions
diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js
index 518c3bdd..ba94fadf 100755
--- a/js/stage/stage-view.reel/stage-view.js
+++ b/js/stage/stage-view.reel/stage-view.js
@@ -25,32 +25,12 @@ exports.StageView = Montage.create(Component, {
25 } 25 }
26 }, 26 },
27 27
28 templateDidLoad: {
29 value: function() {
30 this.eventManager.addEventListener("appLoaded", this, false);
31 }
32 },
33
34 didDraw:{ 28 didDraw:{
35 value: function() { 29 value: function() {
36 if(!this.application.ninja.documentController._textHolder) this.application.ninja.documentController._textHolder = this.element; 30 if(!this.application.ninja.documentController._textHolder) this.application.ninja.documentController._textHolder = this.element;
37 } 31 }
38 }, 32 },
39 33
40 handleAppLoaded: {
41 value: function() {
42
43 // Don't bind for now
44 /*
45 Object.defineBinding(this, "docs", {
46 boundObject: this.application.ninja.documentController,
47 boundObjectPropertyPath: "_documents"
48 });
49 */
50
51 }
52 },
53
54 /** 34 /**
55 * Public method 35 * Public method
56 * Creates a textarea element which will contain the content of the opened text document. 36 * Creates a textarea element which will contain the content of the opened text document.
@@ -140,7 +120,22 @@ exports.StageView = Montage.create(Component, {
140 } 120 }
141 121
142 this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe 122 this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe
143 this.application.ninja.documentController._showCurrentDocument(); 123
124
125// this.application.ninja.documentController._showCurrentDocument();
126 // Inline function below
127 if(this.activeDocument) {
128 this.activeDocument.container.style["display"] = "block";
129 if(this.activeDocument.currentView === "design"){
130 this.activeDocument.container.parentNode.style["display"] = "block";
131 this.activeDocument.restoreAppState();
132 } else {
133 //hide the iframe when switching to code view
134 document.getElementById("iframeContainer").style.display = "none";
135 }
136 }
137
138
144 //focus editor 139 //focus editor
145 if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){ 140 if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){
146 this.application.ninja.documentController.activeDocument.editor.focus(); 141 this.application.ninja.documentController.activeDocument.editor.focus();
@@ -172,17 +167,6 @@ exports.StageView = Montage.create(Component, {
172 } 167 }
173 }, 168 },
174 169
175 hideOtherDocuments:{
176 value:function(docUuid){
177 this.application.ninja.documentController._documents.forEach(function(aDoc){
178 if(aDoc.currentView === "design"){
179 aDoc.container.parentNode.style["display"] = "none";
180 }else if((aDoc.currentView === "code") && (aDoc.uuid !== docUuid)){
181 aDoc.container.style["display"] = "none";
182 }
183 }, this);
184 }
185 },
186 showRulers:{ 170 showRulers:{
187 value:function(){ 171 value:function(){
188 this.application.ninja.rulerTop.style.display = "block"; 172 this.application.ninja.rulerTop.style.display = "block";
@@ -200,7 +184,7 @@ exports.StageView = Montage.create(Component, {
200 if(isCodeView === true) { 184 if(isCodeView === true) {
201 this.application.ninja.editorViewOptions.element.style.display = "block"; 185 this.application.ninja.editorViewOptions.element.style.display = "block";
202 this.application.ninja.documentBar.element.style.display = "none"; 186 this.application.ninja.documentBar.element.style.display = "none";
203 }else{ 187 } else {
204 this.application.ninja.documentBar.element.style.display = "block"; 188 this.application.ninja.documentBar.element.style.display = "block";
205 this.application.ninja.editorViewOptions.element.style.display = "none"; 189 this.application.ninja.editorViewOptions.element.style.display = "none";
206 } 190 }