From 806974142d44afdd23534bf2d18eff0a8e701e0c Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 8 Jun 2012 16:59:59 -0700 Subject: rewrite: currentSelectedContainer -> domContainer Fixed the currentSelectedContainer by removing bindings and using property change on the current document added the red outline back. Signed-off-by: Valerio Virgillito --- js/tools/Rotate3DToolBase.js | 2 +- js/tools/SelectionTool.js | 4 ++-- js/tools/ShapeTool.js | 6 +++--- js/tools/TranslateObject3DTool.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'js/tools') diff --git a/js/tools/Rotate3DToolBase.js b/js/tools/Rotate3DToolBase.js index bf9537dd..f0fe83fa 100755 --- a/js/tools/Rotate3DToolBase.js +++ b/js/tools/Rotate3DToolBase.js @@ -98,7 +98,7 @@ exports.Rotate3DToolBase = Montage.create(ModifierToolBase, { // { // hitRec = snapManager.findHitRecordForElement(elt); // } -// if(elt === this.application.ninja.currentSelectedContainer) +// if(elt === this.application.ninja.currentDocument.model.domContainer) // { // this._clickedOnStage = true; // } diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index ed92b893..493f4aa2 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -224,9 +224,9 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { HandleDoubleClick: { value: function(event) { if(this.application.ninja.selectedElements.length > 0) { - this.application.ninja.currentSelectedContainer = this.application.ninja.selectedElements[0]; + this.application.ninja.currentDocument.model.domContainer = this.application.ninja.selectedElements[0]; } else { - this.application.ninja.currentSelectedContainer = this.application.ninja.currentDocument.model.documentRoot; + this.application.ninja.currentDocument.model.domContainer = this.application.ninja.currentDocument.model.documentRoot; } } }, diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js index 03ddc391..8d381711 100755 --- a/js/tools/ShapeTool.js +++ b/js/tools/ShapeTool.js @@ -103,8 +103,8 @@ exports.ShapeTool = Montage.create(DrawingTool, { if(wasSelected) { this.AddCustomFeedback(); this.application.ninja.elementMediator.addDelegate = this; - if(this.application.ninja.currentSelectedContainer.nodeName === "CANVAS") { - this._targetedElement = this.application.ninja.currentSelectedContainer; + if(this.application.ninja.currentDocument.model.domContainer.nodeName === "CANVAS") { + this._targetedElement = this.application.ninja.currentDocument.model.domContainer; } } else { this.RemoveCustomFeedback(); @@ -199,7 +199,7 @@ exports.ShapeTool = Montage.create(DrawingTool, { target = this._targetedElement; else { - var container = this.application.ninja.currentSelectedContainer; + var container = this.application.ninja.currentDocument.model.domContainer; if (container && (container.nodeName === "CANVAS")) { target = container; diff --git a/js/tools/TranslateObject3DTool.js b/js/tools/TranslateObject3DTool.js index f8b32d23..d9e558a4 100755 --- a/js/tools/TranslateObject3DTool.js +++ b/js/tools/TranslateObject3DTool.js @@ -89,7 +89,7 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, { var otherSnap = snapManager.findHitRecordForElement(elt); if (otherSnap) hitRec = otherSnap; } - if(elt === this.application.ninja.currentSelectedContainer) + if(elt === this.application.ninja.currentDocument.model.domContainer) { this._clickedOnStage = true; } -- cgit v1.2.3