diff options
Diffstat (limited to 'js/ninja.reel')
-rwxr-xr-x | js/ninja.reel/ninja.html | 15 | ||||
-rwxr-xr-x | js/ninja.reel/ninja.js | 20 |
2 files changed, 22 insertions, 13 deletions
diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index 031d68e9..0c0944e7 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html | |||
@@ -25,7 +25,10 @@ | |||
25 | }, | 25 | }, |
26 | 26 | ||
27 | "appModel": { | 27 | "appModel": { |
28 | "prototype": "js/models/app-model" | 28 | "prototype": "js/models/app-model", |
29 | "bindings": { | ||
30 | "currentDocument": {"<-": "@documentList.selectedObjects.0"} | ||
31 | } | ||
29 | }, | 32 | }, |
30 | 33 | ||
31 | "materialsModel": { | 34 | "materialsModel": { |
@@ -212,6 +215,9 @@ | |||
212 | "prototype": "js/code-editor/ui/code-editor-view-options.reel", | 215 | "prototype": "js/code-editor/ui/code-editor-view-options.reel", |
213 | "properties": { | 216 | "properties": { |
214 | "element": {"#": "editorViewOptions"} | 217 | "element": {"#": "editorViewOptions"} |
218 | }, | ||
219 | "bindings" : { | ||
220 | "currentDocument": {"<-": "@documentList.selectedObjects.0"} | ||
215 | } | 221 | } |
216 | }, | 222 | }, |
217 | 223 | ||
@@ -349,7 +355,8 @@ | |||
349 | "codeEditorController": { | 355 | "codeEditorController": { |
350 | "prototype": "js/controllers/code-editor-controller", | 356 | "prototype": "js/controllers/code-editor-controller", |
351 | "bindings": { | 357 | "bindings": { |
352 | "currentDocument": {"<-": "@documentList.selectedObjects.0"} | 358 | "currentDocument": {"<-": "@documentList.selectedObjects.0"}, |
359 | "automaticCodeComplete": {"<-": "@editorViewOptions.codeCompleteCheck.disabled"} | ||
353 | } | 360 | } |
354 | }, | 361 | }, |
355 | 362 | ||
@@ -443,8 +450,8 @@ | |||
443 | <section data-montage-id="timelineResizer" class="timelineResizer resizeBar"></section> | 450 | <section data-montage-id="timelineResizer" class="timelineResizer resizeBar"></section> |
444 | <section id="stateBar"> | 451 | <section id="stateBar"> |
445 | <section id="documentBarContainer"> | 452 | <section id="documentBarContainer"> |
446 | <div data-montage-id="documentBar" class="documentBar" style="display:block"><a href="#">HTML</a></div> | 453 | <div data-montage-id="documentBar" class="documentBar" style="display:block"></div> |
447 | <div data-montage-id="editorViewOptions" class="editorViewOptions" style="display:none"><a href="#">HTML</a></div> | 454 | <div data-montage-id="editorViewOptions" class="editorViewOptions" style="display:none"></div> |
448 | </section> | 455 | </section> |
449 | </section> | 456 | </section> |
450 | 457 | ||
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 4c1efff4..9593973e 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js | |||
@@ -296,9 +296,6 @@ exports.Ninja = Montage.create(Component, { | |||
296 | 296 | ||
297 | openDocument: { | 297 | openDocument: { |
298 | value: function(doc) { | 298 | value: function(doc) { |
299 | |||
300 | |||
301 | |||
302 | this.documentList.content.push(doc); | 299 | this.documentList.content.push(doc); |
303 | // This is not needed with the latest 0.10 montage. | 300 | // This is not needed with the latest 0.10 montage. |
304 | // TODO: Remove this when integrating the next montage | 301 | // TODO: Remove this when integrating the next montage |
@@ -308,19 +305,24 @@ exports.Ninja = Montage.create(Component, { | |||
308 | // TODO: Bind directly to the model of the document in components instead of this property | 305 | // TODO: Bind directly to the model of the document in components instead of this property |
309 | this.currentSelectedContainer = doc.model.documentRoot; | 306 | this.currentSelectedContainer = doc.model.documentRoot; |
310 | } | 307 | } |
311 | |||
312 | |||
313 | // this.appModel.show3dGrid = this.currentDocument.draw3DGrid; | ||
314 | |||
315 | |||
316 | } | 308 | } |
317 | }, | 309 | }, |
318 | 310 | ||
319 | closeFile: { | 311 | closeFile: { |
320 | value: function(document) { | 312 | value: function(document) { |
321 | var doc = this.documentList.content[this.documentList.content.indexOf(document)]; | 313 | var doc = this.documentList.content[this.documentList.content.indexOf(document)], activeDocument; |
314 | |||
315 | if(this.documentList.selectedObjects[0] === doc) { | ||
316 | activeDocument = this.documentList.content[0]; | ||
317 | } else { | ||
318 | activeDocument = this.documentList.selectedObjects[0]; | ||
319 | } | ||
322 | 320 | ||
323 | this.documentList.removeObjects(doc); | 321 | this.documentList.removeObjects(doc); |
322 | |||
323 | if(this.documentList.content.length) { | ||
324 | this.documentList.selectedObjects = [activeDocument]; | ||
325 | } | ||
324 | } | 326 | } |
325 | }, | 327 | }, |
326 | 328 | ||