From ec6759f9821a5647905617e3992fdda1cea390ef Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Tue, 26 Jun 2012 17:17:43 -0700 Subject: Binding View - Hide in Live Preview Signed-off-by: Armen Kesablyan --- js/stage/binding-view.reel/binding-view.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'js/stage/binding-view.reel/binding-view.js') diff --git a/js/stage/binding-view.reel/binding-view.js b/js/stage/binding-view.reel/binding-view.js index 1fc4d583..94c84d02 100755 --- a/js/stage/binding-view.reel/binding-view.js +++ b/js/stage/binding-view.reel/binding-view.js @@ -198,7 +198,7 @@ exports.BindingView = Montage.create(Component, { } }, - _hide : { value: null }, + _hide : { value: true }, hide : { get : function() { return this._hide; }, set : function(value) { @@ -247,12 +247,6 @@ exports.BindingView = Montage.create(Component, { } }, - didDraw: { - value: function() { - - } - }, - drawLine: { value: function(fromX,fromY,toX,toY, color, width) { if(width === null) width = 1; -- cgit v1.2.3 From 9add37d85a9d90541daae8ad5316388c4d9a9da4 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Thu, 28 Jun 2012 13:21:11 -0700 Subject: Binding View - Bug fix After save corrupts doom and breaks binding view Signed-off-by: Armen Kesablyan --- js/stage/binding-view.reel/binding-view.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'js/stage/binding-view.reel/binding-view.js') 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, { } }, - _selectedComponent: { value: null }, - selectedComponent: { + _selectedElement: { value: null }, + selectedElement: { get: function() { - return this._selectedComponent; + return this._selectedElement; }, set: function(val) { this.boundComponents = []; - if(this._selectedComponent !== val) { + if(this._selectedElement !== val) { this.clearCanvas(); - this._selectedComponent = val; - if(this._selectedComponent !== null) { - this.application.ninja.objectsController.currentObject = this.selectedComponent; - if (this.selectedComponent !== null) { - this.boundComponents.push(this.selectedComponent); + this._selectedElement = val; + if(this._selectedElement !== null) { + this.application.ninja.objectsController.currentObject = this._selectedElement.controller; + if (this._selectedElement !== null) { + this.boundComponents.push(this._selectedElement); } } this.needsDraw = true; @@ -219,12 +219,12 @@ exports.BindingView = Montage.create(Component, { this.element.style.removeProperty('display'); this.element.style.width = this.width + "px"; this.element.style.height = this.height + "px"; - if(this.selectedComponent !== null && typeof(this.selectedComponent) !== "undefined") { + if(this._selectedElement !== null && typeof(this._selectedElement) !== "undefined") { this.canvas.width = this.application.ninja.stage.drawingCanvas.offsetWidth; this.canvas.height = this.application.ninja.stage.drawingCanvas.offsetHeight; this.clearCanvas(); for(var i= 0; i < this.hudRepeater.childComponents.length; i++) { - 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); + 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); } if(this._isDrawingConnection) { if (this.hudRepeater.childComponents.length > 1) { @@ -341,7 +341,7 @@ exports.BindingView = Montage.create(Component, { if(this._isDrawingConnection && !overHud) { //NOTE : Continue This content. mouse over select var obj = this.application.ninja.stage.getElement(event, true); - if (obj && obj.controller !== this.selectedComponent) + if (obj && obj !== this.selectedElement) { if (!obj.controller || obj === null) { @@ -363,7 +363,7 @@ exports.BindingView = Montage.create(Component, { } this._targetedElement = obj; this._targetedElement.classList.add("active-element-outline"); - this.boundComponents.push(this._targetedElement.controller); + this.boundComponents.push(this._targetedElement); } } } -- cgit v1.2.3