From d48f086ad64badf07b5f82bf6e0216074eac7a25 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Wed, 16 May 2012 18:25:03 -0700 Subject: Initial Binding Hud Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'js/tools') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index 1a8cb47f..5953c409 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -7,6 +7,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, DrawingTool = require("js/tools/drawing-tool").DrawingTool, ModifierToolBase = require("js/tools/modifier-tool-base").ModifierToolBase; +SelectionTool = require("js/tools/SelectionTool").SelectionTool; exports.BindingTool = Montage.create(ModifierToolBase, { @@ -44,8 +45,24 @@ exports.BindingTool = Montage.create(ModifierToolBase, { HandleLeftButtonUp: { value: function(event) { - this.endDraw(event); - NJevent("disableStageMove"); + + if(this._escape) { + this._escape = false; + return; + } + + if(this._hasDraw) { + this._hasDraw = false; + this.endDraw(event); + } else { + this.doSelection(event); + if (this.application.ninja.selectedElements.length !== 0 ) { + this.selectedElement = this.application.ninja.selectedElements[0]; + } + this._isDrawing = false; + } + //this.endDraw(event); + //NJevent("disableStageMove"); } } }); \ No newline at end of file -- cgit v1.2.3