From f0014635213061f1d945442140257750e666e752 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Tue, 19 Jun 2012 23:07:34 -0700 Subject: Binding View - Added Line cap in drawing line & Fixed bug to not pop up on current component Signed-off-by: Armen Kesablyan --- js/stage/binding-view.reel/binding-view.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (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 aa690ee6..a4aebd1b 100755 --- a/js/stage/binding-view.reel/binding-view.js +++ b/js/stage/binding-view.reel/binding-view.js @@ -216,6 +216,7 @@ exports.BindingView = Montage.create(Component, { if(width === null) width = 1; if (color === null) color = "#CCC"; this._context.lineWidth = width; // Set Line Thickness + this._context.lineCap = "round"; this._context.strokeStyle = color; // Set Color this._context.beginPath(); // Start Drawing Line this._context.moveTo(fromX, fromY); @@ -294,7 +295,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) + if (obj && obj.controller !== this.selectedComponent) { if (!obj.controller || obj === null) { -- cgit v1.2.3 From e506b93b285a1666999afe7cf65317cb6552db03 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Tue, 19 Jun 2012 23:36:35 -0700 Subject: Showing Bound Items in hud Signed-off-by: Armen Kesablyan --- .../binding-hud-option.reel/binding-hud-option.js | 4 ++++ js/stage/binding-view.reel/binding-hud.reel/binding-hud.css | 2 +- js/stage/binding-view.reel/binding-hud.reel/binding-hud.js | 9 ++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) (limited to 'js/stage') diff --git a/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js b/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js index 59e070e8..fb0fd57e 100755 --- a/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js +++ b/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js @@ -33,6 +33,10 @@ exports.BindingHudOption = Montage.create(Component, { prepareForDraw: { value: function() { // Set Up Listener for click and propagate up to Binding View + var matchesBound = this.parentComponent.parentComponent.boundProperties.filter(function(obj) { + return (obj === this.title); + }.bind(this)); + if(matchesBound.length > 0) this.bound = true; } }, diff --git a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.css b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.css index 76b8e37e..f15f1e50 100755 --- a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.css +++ b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.css @@ -46,7 +46,7 @@ cursor: pointer; } -.hudOption.bound, .bindingHud .hudOption.bound { +.bindingHud .hudOption.bound .connectorBubble { background: -webkit-linear-gradient(top, #d0e4f7 0%,#73b1e7 24%,#0a77d5 50%,#539fe1 79%,#87bcea 100%); } diff --git a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js index b03c5a06..fddce11c 100755 --- a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js +++ b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js @@ -20,6 +20,10 @@ exports.BindingHud = Montage.create(Component, { value: null }, + boundProperties: { + value: [] + }, + _userComponent: { value: null }, userComponent: { get: function() { @@ -32,6 +36,9 @@ exports.BindingHud = Montage.create(Component, { this.x = val.element.offsetLeft; this.y = val.element.offsetTop; this.properties = this.application.ninja.objectsController.getPropertiesFromObject(val, true); + this.application.ninja.objectsController.getObjectBindings(this.userComponent).forEach(function(obj) { + this.boundProperties.push(obj.sourceObjectPropertyPath); + }.bind(this)); this.needsDraw = true; } } @@ -133,7 +140,7 @@ exports.BindingHud = Montage.create(Component, { // } // this.properties.push({"title":obj, "bound": objBound}); // }.bind(this)); - this.parentComponent.parentComponent.handleShowBinding(this.application.ninja.objectsController.getObjectBindings(this.userComponent)); + //this.parentComponent.parentComponent.handleShowBinding(this.application.ninja.objectsController.getObjectBindings(this.userComponent)); } }, -- cgit v1.2.3