From 7283884c39df537694b21419a3ea9e3ca7793b4b Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 23 Feb 2012 13:43:35 -0800 Subject: switch html document - re-initialize draw-utils and snap-manager on opening a document and while switching documents Signed-off-by: Ananya Sen --- js/controllers/selection-controller.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'js/controllers/selection-controller.js') diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index d69b53e0..f50762f3 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js @@ -58,6 +58,7 @@ exports.SelectionController = Montage.create(Component, { handleOpenDocument: { value: function() { // Handle initializing the selection array here. + this.initWithDocument([]); } }, @@ -70,6 +71,14 @@ exports.SelectionController = Montage.create(Component, { if(currentSelectionArray.length >= 1) { this._selectedItems = currentSelectionArray; this._isDocument = false; + + + + this.application.ninja.selectedElements = currentSelectionArray; + NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); + + + } } -- cgit v1.2.3