From 7655e32da5bcdf7b205afc1908c9b7bcc661b0d4 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Sat, 2 Jun 2012 20:54:30 -0700 Subject: binding canvas Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'js/tools') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index a467ed3e..6b541096 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -12,6 +12,18 @@ SelectionTool = require("js/tools/SelectionTool").SelectionTool; exports.BindingTool = Montage.create(ModifierToolBase, { drawingFeedback: { value: { mode: "Draw2D", type: "" } }, + _selectedComponent: { + value: null + }, + + selectedComponent: { + get:function() { + return this._selectedComponent; + }, + set: function(val) { + this._selectedComponent = val; + } + }, Configure: { value: function (doActivate) @@ -32,13 +44,13 @@ exports.BindingTool = Montage.create(ModifierToolBase, { HandleLeftButtonDown: { value: function(event) { NJevent("enableStageMove"); - this.application.ninja.stage.bindingView.handleMouseDown(event); + this.application.ninja.stage.bindingView.handleMousedown(event); } }, HandleMouseMove: { value: function(event) { - this.doDraw(event); + //this.doDraw(event); } }, @@ -56,11 +68,14 @@ exports.BindingTool = Montage.create(ModifierToolBase, { } else { this.doSelection(event); if (this.application.ninja.selectedElements.length !== 0 ) { - this.selectedElement = this.application.ninja.selectedElements[0]; + if(this.application.ninja.selectedElements[0].controller) { + this.selectedComponent = this.application.ninja.selectedElements[0].controller; + } } else { - this.selectedElement = null; + this.selectedComponent = null; } - this.application.ninja.stage.bindingView.selectedElement = this.selectedElement; + this.application.ninja.stage.bindingView.selectedElement = this.selectedComponent; + this.application.ninja.objectsController.currentObject = this.selectedComponent; this._isDrawing = false; } //this.endDraw(event); -- cgit v1.2.3