From 5d7dff15e1e603e3b37057b9843e4b1eef1b2dca Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 29 May 2012 15:32:47 -0700 Subject: cleanup and handling the document views in the document controller for now. Signed-off-by: Valerio Virgillito --- js/ninja.reel/ninja.html | 5 ++++- js/ninja.reel/ninja.js | 25 +++++++++---------------- 2 files changed, 13 insertions(+), 17 deletions(-) (limited to 'js/ninja.reel') diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index 51d6ed89..a62ce458 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -277,7 +277,10 @@ }, "documentController": { - "prototype": "js/controllers/document-controller" + "prototype": "js/controllers/document-controller", + "bindings": { + "currentDocument": {"<-": "@documentList.selectedObjects.0"} + } }, "documentList": { diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 0b4fd14d..3659f1f8 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -296,7 +296,7 @@ exports.Ninja = Montage.create(Component, { } }, - handleOnOpenDocument: { + openDocument: { value: function(doc) { @@ -306,25 +306,18 @@ exports.Ninja = Montage.create(Component, { // TODO: Remove this when integrating the next montage this.documentList.selectedObjects = [doc]; - // TODO: Find a better place for this - doc.model.currentView.show(); - // TODO: Bind directly to the model of the document in components instead of this property this.currentSelectedContainer = doc.model.documentRoot; - /* - this.currentDocument = event.detail; - - if(this.currentDocument.model.documentRoot) { - this.currentSelectedContainer = this.currentDocument.model.documentRoot; - } else { - alert("The current document has not loaded yet"); - return; - } +// if(this.currentDocument.model.documentRoot) { +// this.currentSelectedContainer = this.currentDocument.model.documentRoot; +// } else { +// alert("The current document has not loaded yet"); +// return; +// } - this.appModel.show3dGrid = this.currentDocument.draw3DGrid; - NJevent("openDocument"); - */ +// this.appModel.show3dGrid = this.currentDocument.draw3DGrid; +// NJevent("openDocument"); } }, -- cgit v1.2.3