From 0a769756547acb93346d8e1b4126931a78845255 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Wed, 30 May 2012 17:45:38 -0700 Subject: opening code view documents Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.html | 5 ++++- js/ninja.reel/ninja.js | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'js/ninja.reel') diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index ab4eed84..d9bebc36 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -345,7 +345,10 @@ }, "codeEditorController": { - "prototype": "js/controllers/code-editor-controller" + "prototype": "js/controllers/code-editor-controller", + "bindings": { + "currentDocument": {"<-": "@documentList.selectedObjects.0"} + } }, "owner": { diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 987c32fd..3c60bb41 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -306,8 +306,10 @@ exports.Ninja = Montage.create(Component, { // TODO: Remove this when integrating the next montage this.documentList.selectedObjects = [doc]; - // TODO: Bind directly to the model of the document in components instead of this property - this.currentSelectedContainer = doc.model.documentRoot; + if(doc.currentView === "design") { + // TODO: Bind directly to the model of the document in components instead of this property + this.currentSelectedContainer = doc.model.documentRoot; + } // if(this.currentDocument.model.documentRoot) { // this.currentSelectedContainer = this.currentDocument.model.documentRoot; -- cgit v1.2.3