aboutsummaryrefslogtreecommitdiff
path: root/js/stage/binding-view.reel/binding-view.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/stage/binding-view.reel/binding-view.js')
-rwxr-xr-xjs/stage/binding-view.reel/binding-view.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/js/stage/binding-view.reel/binding-view.js b/js/stage/binding-view.reel/binding-view.js
index 94c84d02..ee44758c 100755
--- a/js/stage/binding-view.reel/binding-view.js
+++ b/js/stage/binding-view.reel/binding-view.js
@@ -97,20 +97,20 @@ exports.BindingView = Montage.create(Component, {
97 } 97 }
98 }, 98 },
99 99
100 _selectedComponent: { value: null }, 100 _selectedElement: { value: null },
101 selectedComponent: { 101 selectedElement: {
102 get: function() { 102 get: function() {
103 return this._selectedComponent; 103 return this._selectedElement;
104 }, 104 },
105 set: function(val) { 105 set: function(val) {
106 this.boundComponents = []; 106 this.boundComponents = [];
107 if(this._selectedComponent !== val) { 107 if(this._selectedElement !== val) {
108 this.clearCanvas(); 108 this.clearCanvas();
109 this._selectedComponent = val; 109 this._selectedElement = val;
110 if(this._selectedComponent !== null) { 110 if(this._selectedElement !== null) {
111 this.application.ninja.objectsController.currentObject = this.selectedComponent; 111 this.application.ninja.objectsController.currentObject = this._selectedElement.controller;
112 if (this.selectedComponent !== null) { 112 if (this._selectedElement !== null) {
113 this.boundComponents.push(this.selectedComponent); 113 this.boundComponents.push(this._selectedElement);
114 } 114 }
115 } 115 }
116 this.needsDraw = true; 116 this.needsDraw = true;
@@ -219,12 +219,12 @@ exports.BindingView = Montage.create(Component, {
219 this.element.style.removeProperty('display'); 219 this.element.style.removeProperty('display');
220 this.element.style.width = this.width + "px"; 220 this.element.style.width = this.width + "px";
221 this.element.style.height = this.height + "px"; 221 this.element.style.height = this.height + "px";
222 if(this.selectedComponent !== null && typeof(this.selectedComponent) !== "undefined") { 222 if(this._selectedElement !== null && typeof(this._selectedElement) !== "undefined") {
223 this.canvas.width = this.application.ninja.stage.drawingCanvas.offsetWidth; 223 this.canvas.width = this.application.ninja.stage.drawingCanvas.offsetWidth;
224 this.canvas.height = this.application.ninja.stage.drawingCanvas.offsetHeight; 224 this.canvas.height = this.application.ninja.stage.drawingCanvas.offsetHeight;
225 this.clearCanvas(); 225 this.clearCanvas();
226 for(var i= 0; i < this.hudRepeater.childComponents.length; i++) { 226 for(var i= 0; i < this.hudRepeater.childComponents.length; i++) {
227 this.drawLine(this.hudRepeater.objects[i].element.offsetLeft,this.hudRepeater.objects[i].element.offsetTop, this.hudRepeater.childComponents[i].element.offsetLeft +3, this.hudRepeater.childComponents[i].element.offsetTop +3, "#CCC", 2); 227 this.drawLine(this.hudRepeater.objects[i].offsetLeft,this.hudRepeater.objects[i].offsetTop, this.hudRepeater.childComponents[i].element.offsetLeft +1, this.hudRepeater.childComponents[i].element.offsetTop +1, "#CCC", 2);
228 } 228 }
229 if(this._isDrawingConnection) { 229 if(this._isDrawingConnection) {
230 if (this.hudRepeater.childComponents.length > 1) { 230 if (this.hudRepeater.childComponents.length > 1) {
@@ -341,7 +341,7 @@ exports.BindingView = Montage.create(Component, {
341 if(this._isDrawingConnection && !overHud) { 341 if(this._isDrawingConnection && !overHud) {
342 //NOTE : Continue This content. mouse over select 342 //NOTE : Continue This content. mouse over select
343 var obj = this.application.ninja.stage.getElement(event, true); 343 var obj = this.application.ninja.stage.getElement(event, true);
344 if (obj && obj.controller !== this.selectedComponent) 344 if (obj && obj !== this.selectedElement)
345 { 345 {
346 if (!obj.controller || obj === null) 346 if (!obj.controller || obj === null)
347 { 347 {
@@ -363,7 +363,7 @@ exports.BindingView = Montage.create(Component, {
363 } 363 }
364 this._targetedElement = obj; 364 this._targetedElement = obj;
365 this._targetedElement.classList.add("active-element-outline"); 365 this._targetedElement.classList.add("active-element-outline");
366 this.boundComponents.push(this._targetedElement.controller); 366 this.boundComponents.push(this._targetedElement);
367 } 367 }
368 } 368 }
369 } 369 }