diff options
Diffstat (limited to 'js/stage/binding-view.reel/binding-view.js')
-rwxr-xr-x | js/stage/binding-view.reel/binding-view.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/js/stage/binding-view.reel/binding-view.js b/js/stage/binding-view.reel/binding-view.js index 94c84d02..9e1b3e22 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 | } |
@@ -386,7 +386,7 @@ exports.BindingView = Montage.create(Component, { | |||
386 | // var mouseUpPoint = new WebKitPoint(e.pageX, e.pageY); | 386 | // var mouseUpPoint = new WebKitPoint(e.pageX, e.pageY); |
387 | // var nodeEl = new webkitConvertPointFromPageToNode(this.element, mouseUpPoint); | 387 | // var nodeEl = new webkitConvertPointFromPageToNode(this.element, mouseUpPoint); |
388 | //debugger; | 388 | //debugger; |
389 | this.connectionElementEnd = nodeEl.parentElement.controller.parentComponent.parentComponent.userComponent; | 389 | this.connectionElementEnd = nodeEl.parentElement.controller.parentComponent.parentComponent.userElement.controller; |
390 | this.connectionPropertyEnd = nodeEl.parentElement.controller.title; | 390 | this.connectionPropertyEnd = nodeEl.parentElement.controller.title; |
391 | this.application.ninja.objectsController.addBinding({ | 391 | this.application.ninja.objectsController.addBinding({ |
392 | sourceObject: this.connectionElementStart, | 392 | sourceObject: this.connectionElementStart, |
@@ -409,7 +409,7 @@ exports.BindingView = Montage.create(Component, { | |||
409 | value: function(e) { | 409 | value: function(e) { |
410 | // We are looking for a mouse down on an option to start the connection visual | 410 | // We are looking for a mouse down on an option to start the connection visual |
411 | if(e._event.target.classList.contains("connectorBubble")) { | 411 | if(e._event.target.classList.contains("connectorBubble")) { |
412 | this.connectionElementStart = e._event.target.parentElement.controller.parentComponent.parentComponent.userComponent; | 412 | this.connectionElementStart = e._event.target.parentElement.controller.parentComponent.parentComponent.userElement.controller; |
413 | this.connectionPropertyStart = e._event.target.parentElement.controller.title; | 413 | this.connectionPropertyStart = e._event.target.parentElement.controller.title; |
414 | this._isDrawingConnection = true; | 414 | this._isDrawingConnection = true; |
415 | this._connectionPositionStart = webkitConvertPointFromPageToNode(this.element, new WebKitPoint(e.pageX, e.pageY)); | 415 | this._connectionPositionStart = webkitConvertPointFromPageToNode(this.element, new WebKitPoint(e.pageX, e.pageY)); |