From 24c6741d594b9d4167cd4de407a625eb43ebe7cc Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Sat, 23 Jun 2012 13:58:16 -0700 Subject: Binding View: Fixed If Selected Div Erroring Out Signed-off-by: Armen Kesablyan --- js/stage/binding-view.reel/binding-view.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/stage') diff --git a/js/stage/binding-view.reel/binding-view.js b/js/stage/binding-view.reel/binding-view.js index c2407b13..1fc4d583 100755 --- a/js/stage/binding-view.reel/binding-view.js +++ b/js/stage/binding-view.reel/binding-view.js @@ -109,7 +109,9 @@ exports.BindingView = Montage.create(Component, { this._selectedComponent = val; if(this._selectedComponent !== null) { this.application.ninja.objectsController.currentObject = this.selectedComponent; - this.boundComponents.push(this.selectedComponent); + if (this.selectedComponent !== null) { + this.boundComponents.push(this.selectedComponent); + } } this.needsDraw = true; } @@ -217,7 +219,7 @@ 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) { + if(this.selectedComponent !== null && typeof(this.selectedComponent) !== "undefined") { this.canvas.width = this.application.ninja.stage.drawingCanvas.offsetWidth; this.canvas.height = this.application.ninja.stage.drawingCanvas.offsetHeight; this.clearCanvas(); -- cgit v1.2.3