From 3a3a2351ea2d816bf953cbf76622772f7d64aa8b Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 1 Jun 2012 00:16:31 -0700 Subject: fixing the code editor, closing documents and cleanup of the stage Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.html | 10 +++++++--- js/ninja.reel/ninja.js | 12 +++++++++++- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'js/ninja.reel') 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 @@ "prototype": "js/code-editor/ui/code-editor-view-options.reel", "properties": { "element": {"#": "editorViewOptions"} + }, + "bindings" : { + "currentDocument": {"<-": "@documentList.selectedObjects.0"} } }, @@ -349,7 +352,8 @@ "codeEditorController": { "prototype": "js/controllers/code-editor-controller", "bindings": { - "currentDocument": {"<-": "@documentList.selectedObjects.0"} + "currentDocument": {"<-": "@documentList.selectedObjects.0"}, + "automaticCodeComplete": {"<-": "@editorViewOptions.codeCompleteCheck.disabled"} } }, @@ -443,8 +447,8 @@
- - +
+
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, { closeFile: { value: function(document) { - var doc = this.documentList.content[this.documentList.content.indexOf(document)]; + var doc = this.documentList.content[this.documentList.content.indexOf(document)], activeDocument; + + if(this.documentList.selectedObjects[0] === doc) { + activeDocument = this.documentList.content[0]; + } else { + activeDocument = this.documentList.selectedObjects[0]; + } this.documentList.removeObjects(doc); + + if(this.documentList.content.length) { + this.documentList.selectedObjects = [activeDocument]; + } } }, -- cgit v1.2.3 From 7fcb10270f9e19415f8452c261c2d0c86916a29a Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 1 Jun 2012 00:54:02 -0700 Subject: fixed the 3d grid when switching documents and some cleanup Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.html | 5 ++++- js/ninja.reel/ninja.js | 8 -------- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'js/ninja.reel') diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index a6422f6e..0c0944e7 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -25,7 +25,10 @@ }, "appModel": { - "prototype": "js/models/app-model" + "prototype": "js/models/app-model", + "bindings": { + "currentDocument": {"<-": "@documentList.selectedObjects.0"} + } }, "materialsModel": { diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index e9e1e31c..9593973e 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -296,9 +296,6 @@ exports.Ninja = Montage.create(Component, { openDocument: { value: function(doc) { - - - this.documentList.content.push(doc); // This is not needed with the latest 0.10 montage. // TODO: Remove this when integrating the next montage @@ -308,11 +305,6 @@ exports.Ninja = Montage.create(Component, { // TODO: Bind directly to the model of the document in components instead of this property this.currentSelectedContainer = doc.model.documentRoot; } - - -// this.appModel.show3dGrid = this.currentDocument.draw3DGrid; - - } }, -- cgit v1.2.3