aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools')
-rw-r--r--js/tools/bindingTool.js26
1 files changed, 20 insertions, 6 deletions
diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js
index 08f9333c..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)
@@ -20,7 +32,6 @@ exports.BindingTool = Montage.create(ModifierToolBase, {
20 { 32 {
21 NJevent("enableStageMove"); 33 NJevent("enableStageMove");
22 this.application.ninja.workspaceMode = "binding"; 34 this.application.ninja.workspaceMode = "binding";
23
24 } 35 }
25 else 36 else
26 { 37 {
@@ -33,12 +44,13 @@ exports.BindingTool = Montage.create(ModifierToolBase, {
33 HandleLeftButtonDown: { 44 HandleLeftButtonDown: {
34 value: function(event) { 45 value: function(event) {
35 NJevent("enableStageMove"); 46 NJevent("enableStageMove");
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,12 +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;
64 this.application.ninja.objectsController.currentObject = this.selectedElement.controller; 78 this.application.ninja.objectsController.currentObject = this.selectedComponent;
65 this._isDrawing = false; 79 this._isDrawing = false;
66 } 80 }
67 //this.endDraw(event); 81 //this.endDraw(event);