From 75fc82ce49d6f1eb05dc950b46292d42b5856005 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 1 Jun 2012 16:19:04 -0700 Subject: fixing some selection container changes and the breadcrumb not drawing initially Signed-off-by: Valerio Virgillito --- js/controllers/selection-controller.js | 2 +- js/document/models/base.js | 11 ++++++++++- js/ninja.reel/ninja.html | 2 +- js/ninja.reel/ninja.js | 1 + 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 28c0f3d3..4bca0755 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js @@ -34,7 +34,7 @@ exports.SelectionController = Montage.create(Component, { } if(this._currentDocument && this._currentDocument.currentView === "design") { - this._currentDocument.model.selection = this.application.ninja.selectedElements; + this._currentDocument.model._selection = this.application.ninja.selectedElements; this._currentDocument.model.selectionContainer = this.application.ninja._currentSelectedContainer; } diff --git a/js/document/models/base.js b/js/document/models/base.js index 886a4ef0..76a5e62b 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -62,9 +62,18 @@ exports.BaseDocumentModel = Montage.create(Component, { }, //////////////////////////////////////////////////////////////////// // - selection: { + _selection: { value: [] }, + + selection: { + get: function() { + return this._selection; + }, + set: function(value) { + this._selection = value; + } + }, //////////////////////////////////////////////////////////////////// // fileTemplate: { diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index 33c3080f..a98fca60 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -246,7 +246,7 @@ "element":{"#" : "breadCrumbComponent"} }, "bindings" : { - "container": {"<<->": "@owner.currentSelectedContainer"}, + "container": {"<-": "@owner.currentSelectedContainer"}, "currentDocument": {"<-": "@documentList.selectedObjects.0"} } }, diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index ac883923..a12270a0 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -292,6 +292,7 @@ exports.Ninja = Montage.create(Component, { if(doc.currentView === "design") { // TODO: Bind directly to the model of the document in components instead of this property + this._currentSelectedContainer = null; this.currentSelectedContainer = doc.model.documentRoot; } } -- cgit v1.2.3