aboutsummaryrefslogtreecommitdiff
path: root/js/tools/bindingTool.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools/bindingTool.js')
-rw-r--r--js/tools/bindingTool.js25
1 files changed, 20 insertions, 5 deletions
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;
12 12
13exports.BindingTool = Montage.create(ModifierToolBase, { 13exports.BindingTool = Montage.create(ModifierToolBase, {
14 drawingFeedback: { value: { mode: "Draw2D", type: "" } }, 14 drawingFeedback: { value: { mode: "Draw2D", type: "" } },
15 _selectedComponent: {
16 value: null
17 },
18
19 selectedComponent: {
20 get:function() {
21 return this._selectedComponent;
22 },
23 set: function(val) {
24 this._selectedComponent = val;
25 }
26 },
15 27
16 Configure: { 28 Configure: {
17 value: function (doActivate) 29 value: function (doActivate)
@@ -32,13 +44,13 @@ exports.BindingTool = Montage.create(ModifierToolBase, {
32 HandleLeftButtonDown: { 44 HandleLeftButtonDown: {
33 value: function(event) { 45 value: function(event) {
34 NJevent("enableStageMove"); 46 NJevent("enableStageMove");
35 this.application.ninja.stage.bindingView.handleMouseDown(event); 47 this.application.ninja.stage.bindingView.handleMousedown(event);
36 } 48 }
37 }, 49 },
38 50
39 HandleMouseMove: { 51 HandleMouseMove: {
40 value: function(event) { 52 value: function(event) {
41 this.doDraw(event); 53 //this.doDraw(event);
42 } 54 }
43 }, 55 },
44 56
@@ -56,11 +68,14 @@ exports.BindingTool = Montage.create(ModifierToolBase, {
56 } else { 68 } else {
57 this.doSelection(event); 69 this.doSelection(event);
58 if (this.application.ninja.selectedElements.length !== 0 ) { 70 if (this.application.ninja.selectedElements.length !== 0 ) {
59 this.selectedElement = this.application.ninja.selectedElements[0]; 71 if(this.application.ninja.selectedElements[0].controller) {
72 this.selectedComponent = this.application.ninja.selectedElements[0].controller;
73 }
60 } else { 74 } else {
61 this.selectedElement = null; 75 this.selectedComponent = null;
62 } 76 }
63 this.application.ninja.stage.bindingView.selectedElement = this.selectedElement; 77 this.application.ninja.stage.bindingView.selectedElement = this.selectedComponent;
78 this.application.ninja.objectsController.currentObject = this.selectedComponent;
64 this._isDrawing = false; 79 this._isDrawing = false;
65 } 80 }
66 //this.endDraw(event); 81 //this.endDraw(event);