aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/panels/binding/binding-item.reel/binding-item.js12
-rwxr-xr-xjs/stage/binding-view.reel/binding-view.js6
-rw-r--r--js/tools/bindingTool.js9
3 files changed, 12 insertions, 15 deletions
diff --git a/js/panels/binding/binding-item.reel/binding-item.js b/js/panels/binding/binding-item.reel/binding-item.js
index a1017020..adc6320c 100644
--- a/js/panels/binding/binding-item.reel/binding-item.js
+++ b/js/panels/binding/binding-item.reel/binding-item.js
@@ -106,18 +106,6 @@ exports.BindingItem = Montage.create(Component, {
106 106
107 /* -------------- Component Draw Cycle -------------- */ 107 /* -------------- Component Draw Cycle -------------- */
108 108
109 templateDidLoad : {
110 value: function() {
111 console.log("loaded binding item");
112 }
113 },
114
115 prepareForDraw: {
116 value: function() {
117 console.log("preparing to draw binding item");
118 }
119 },
120
121 draw : { 109 draw : {
122 value: function() { 110 value: function() {
123 if(this.oneway) { 111 if(this.oneway) {
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, {
109 this._selectedComponent = val; 109 this._selectedComponent = val;
110 if(this._selectedComponent !== null) { 110 if(this._selectedComponent !== null) {
111 this.application.ninja.objectsController.currentObject = this.selectedComponent; 111 this.application.ninja.objectsController.currentObject = this.selectedComponent;
112 this.boundComponents.push(this.selectedComponent); 112 if (this.selectedComponent !== null) {
113 this.boundComponents.push(this.selectedComponent);
114 }
113 } 115 }
114 this.needsDraw = true; 116 this.needsDraw = true;
115 } 117 }
@@ -217,7 +219,7 @@ exports.BindingView = Montage.create(Component, {
217 this.element.style.removeProperty('display'); 219 this.element.style.removeProperty('display');
218 this.element.style.width = this.width + "px"; 220 this.element.style.width = this.width + "px";
219 this.element.style.height = this.height + "px"; 221 this.element.style.height = this.height + "px";
220 if(this.selectedComponent !== null) { 222 if(this.selectedComponent !== null && typeof(this.selectedComponent) !== "undefined") {
221 this.canvas.width = this.application.ninja.stage.drawingCanvas.offsetWidth; 223 this.canvas.width = this.application.ninja.stage.drawingCanvas.offsetWidth;
222 this.canvas.height = this.application.ninja.stage.drawingCanvas.offsetHeight; 224 this.canvas.height = this.application.ninja.stage.drawingCanvas.offsetHeight;
223 this.clearCanvas(); 225 this.clearCanvas();
diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js
index b284fc47..1e1c9e5b 100644
--- a/js/tools/bindingTool.js
+++ b/js/tools/bindingTool.js
@@ -34,7 +34,12 @@ exports.BindingTool = Montage.create(ModifierToolBase, {
34 NJevent("enableStageMove"); 34 NJevent("enableStageMove");
35 this.application.ninja.workspaceMode = "binding"; 35 this.application.ninja.workspaceMode = "binding";
36 if (this.application.ninja.selectedElements.length !== 0 ) { 36 if (this.application.ninja.selectedElements.length !== 0 ) {
37 this.selectedComponent = this.application.ninja.selectedElements[0].controller; 37 if(typeof(this.application.ninja.selectedElements[0].controller) !== "undefined") {
38 this.selectedComponent = this.application.ninja.selectedElements[0].controller;
39 } else {
40 this.selectedComponent = null;
41 }
42
38 } 43 }
39 } 44 }
40 else 45 else
@@ -81,6 +86,8 @@ exports.BindingTool = Montage.create(ModifierToolBase, {
81 if (this.application.ninja.selectedElements.length !== 0 ) { 86 if (this.application.ninja.selectedElements.length !== 0 ) {
82 if(this.application.ninja.selectedElements[0].controller) { 87 if(this.application.ninja.selectedElements[0].controller) {
83 this.selectedComponent = this.application.ninja.selectedElements[0].controller; 88 this.selectedComponent = this.application.ninja.selectedElements[0].controller;
89 } else {
90 this.selectedComponent = null;
84 } 91 }
85 } else { 92 } else {
86 this.selectedComponent = null; 93 this.selectedComponent = null;