You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aries.apache.org by zo...@apache.org on 2010/06/13 15:57:33 UTC

svn commit: r954225 - /incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipElement.js

Author: zoe
Date: Sun Jun 13 13:57:33 2010
New Revision: 954225

URL: http://svn.apache.org/viewvc?rev=954225&view=rev
Log:
ARIES-319 Remove superfluous line drawing in constructor, tidy logic in updateVisibility()

Modified:
    incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipElement.js

Modified: incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipElement.js
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipElement.js?rev=954225&r1=954224&r2=954225&view=diff
==============================================================================
--- incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipElement.js (original)
+++ incubator/aries/trunk/samples/goat/goat-web/src/main/resources/web/goat/elements/RelationshipElement.js Sun Jun 13 13:57:33 2010
@@ -72,7 +72,6 @@ constructor: function(surface, name, typ
 	this.stroke = '#000000';
     this.setStroke();
 	this.updateVisibility();
-	this.updateLine(); 
 		
 	this.subs=new Array();
 	this.subs.push(dojo.subscribe("goat.component.move."+fromComponent.id, this, this.onComponentMove));
@@ -121,12 +120,12 @@ updateVisibility: function(){
 		//console.log(this);
 	//}
 	
+	// Visible will be 'true' only if both componenets are not hidden (ie visible)
 	this.visible = (!this.fromComponent.hidden) && (!this.toComponent.hidden);
 	
 	if(!this.visible){
-		if(this.line==null){
-			// No need to erase a line which doesn't exist ...
-		}else{
+		if(this.line!=null){
+		//No need to hide a line that doesn't exist.
 			this.line.setShape({x1: -1000, y1: -1000, x2: -1000, y2: -1000});
 
             //console.log("Hiding decorators..");