aboutsummaryrefslogtreecommitdiff
path: root/js/stage/stage-view.reel/stage-view.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/stage/stage-view.reel/stage-view.js')
-rwxr-xr-xjs/stage/stage-view.reel/stage-view.js14
1 files changed, 5 insertions, 9 deletions
diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js
index dc9980f0..0b688c75 100755
--- a/js/stage/stage-view.reel/stage-view.js
+++ b/js/stage/stage-view.reel/stage-view.js
@@ -122,10 +122,6 @@ exports.StageView = Montage.create(Component, {
122 122
123 switchDocument:{ 123 switchDocument:{
124 value: function(doc){ 124 value: function(doc){
125 //save editor cursor position
126 if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){
127 this.application.ninja.documentController.activeDocument.hline = this.application.ninja.documentController.activeDocument.editor.getCursor(true);
128 }
129 this.application.ninja.documentController._hideCurrentDocument(); 125 this.application.ninja.documentController._hideCurrentDocument();
130 126
131 this.application.ninja.documentController.activeDocument = doc; 127 this.application.ninja.documentController.activeDocument = doc;
@@ -133,17 +129,17 @@ exports.StageView = Montage.create(Component, {
133 this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe 129 this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe
134 this.application.ninja.documentController._showCurrentDocument(); 130 this.application.ninja.documentController._showCurrentDocument();
135 131
136 var documentController = this.application.ninja.documentController; 132 //focus current document
137
138 //restore editor cursor position
139 if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){ 133 if(!!this.application.ninja.documentController.activeDocument && !!this.application.ninja.documentController.activeDocument.editor){
140 this.application.ninja.documentController.activeDocument.editor.setCursor(this.application.ninja.documentController.activeDocument.hline);
141 document.getElementById("codeMirror_"+this.application.ninja.documentController.activeDocument.uuid).getElementsByClassName("CodeMirror")[0].focus(); 134 document.getElementById("codeMirror_"+this.application.ninja.documentController.activeDocument.uuid).getElementsByClassName("CodeMirror")[0].focus();
142 } 135 }
143 136
144 if(this.application.ninja.documentController.activeDocument.currentView === "design") { 137 if(this.application.ninja.documentController.activeDocument.currentView === "design") {
145 this.application.ninja.stage._scrollFlag = true; // TODO HACK to prevent type error on Hide/Show Iframe 138 this.application.ninja.stage._scrollFlag = true; // TODO HACK to prevent type error on Hide/Show Iframe
146 this.application.ninja.currentDocument = this.application.ninja.documentController.activeDocument; 139 this.application.ninja.currentDocument = this.application.ninja.documentController.activeDocument;
140
141 this.application.ninja.stage.snapManager._isCacheInvalid=true;
142 this.application.ninja.stage.drawUtils.initializeFromDocument();
147 143
148 // TODO dispatch event here 144 // TODO dispatch event here
149 // appDelegateModule.MyAppDelegate.onSetActiveDocument(); 145 // appDelegateModule.MyAppDelegate.onSetActiveDocument();