aboutsummaryrefslogtreecommitdiff
path: root/js/ninja.reel
diff options
context:
space:
mode:
authorValerio Virgillito2012-06-01 00:16:31 -0700
committerValerio Virgillito2012-06-01 00:16:31 -0700
commit3a3a2351ea2d816bf953cbf76622772f7d64aa8b (patch)
tree0e26399a2bbf4702aeb30de9a8f46442ca8b99ab /js/ninja.reel
parent6ae2ff1ce956e518918f65099d052bb42186dc94 (diff)
downloadninja-3a3a2351ea2d816bf953cbf76622772f7d64aa8b.tar.gz
fixing the code editor, closing documents and cleanup of the stage
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/ninja.reel')
-rwxr-xr-xjs/ninja.reel/ninja.html10
-rwxr-xr-xjs/ninja.reel/ninja.js12
2 files changed, 18 insertions, 4 deletions
diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html
index 031d68e9..a6422f6e 100755
--- a/js/ninja.reel/ninja.html
+++ b/js/ninja.reel/ninja.html
@@ -212,6 +212,9 @@
212 "prototype": "js/code-editor/ui/code-editor-view-options.reel", 212 "prototype": "js/code-editor/ui/code-editor-view-options.reel",
213 "properties": { 213 "properties": {
214 "element": {"#": "editorViewOptions"} 214 "element": {"#": "editorViewOptions"}
215 },
216 "bindings" : {
217 "currentDocument": {"<-": "@documentList.selectedObjects.0"}
215 } 218 }
216 }, 219 },
217 220
@@ -349,7 +352,8 @@
349 "codeEditorController": { 352 "codeEditorController": {
350 "prototype": "js/controllers/code-editor-controller", 353 "prototype": "js/controllers/code-editor-controller",
351 "bindings": { 354 "bindings": {
352 "currentDocument": {"<-": "@documentList.selectedObjects.0"} 355 "currentDocument": {"<-": "@documentList.selectedObjects.0"},
356 "automaticCodeComplete": {"<-": "@editorViewOptions.codeCompleteCheck.disabled"}
353 } 357 }
354 }, 358 },
355 359
@@ -443,8 +447,8 @@
443 <section data-montage-id="timelineResizer" class="timelineResizer resizeBar"></section> 447 <section data-montage-id="timelineResizer" class="timelineResizer resizeBar"></section>
444 <section id="stateBar"> 448 <section id="stateBar">
445 <section id="documentBarContainer"> 449 <section id="documentBarContainer">
446 <div data-montage-id="documentBar" class="documentBar" style="display:block"><a href="#">HTML</a></div> 450 <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> 451 <div data-montage-id="editorViewOptions" class="editorViewOptions" style="display:none"></div>
448 </section> 452 </section>
449 </section> 453 </section>
450 454
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js
index 4c1efff4..e9e1e31c 100755
--- a/js/ninja.reel/ninja.js
+++ b/js/ninja.reel/ninja.js
@@ -318,9 +318,19 @@ exports.Ninja = Montage.create(Component, {
318 318
319 closeFile: { 319 closeFile: {
320 value: function(document) { 320 value: function(document) {
321 var doc = this.documentList.content[this.documentList.content.indexOf(document)]; 321 var doc = this.documentList.content[this.documentList.content.indexOf(document)], activeDocument;
322
323 if(this.documentList.selectedObjects[0] === doc) {
324 activeDocument = this.documentList.content[0];
325 } else {
326 activeDocument = this.documentList.selectedObjects[0];
327 }
322 328
323 this.documentList.removeObjects(doc); 329 this.documentList.removeObjects(doc);
330
331 if(this.documentList.content.length) {
332 this.documentList.selectedObjects = [activeDocument];
333 }
324 } 334 }
325 }, 335 },
326 336