So I have a paper that has 6 types of symbols. Each symbol is a collection of circles and paths. I only want to make some of circles clickable to drag the set. For example, if a symbol has 2 circles and a path - I want to be able to click one of the circles to drag and drop the set(something that has been well documented). If the user clicks the other circle - nothing should happen. Since my Raphael elements are created dynamically by the user - I push each set as it's created onto an array. Is it possible for me to access the particular circle in the set and make it clickable through the array of sets?
Here's how I insert a set
{
paper.setStart();
var circ = paper.circle(x,y,35); //first circle - should be clickable
var conpoints = insConPoint1(paper,x,y);
var pathright = conpoints.path;
var conPoint1 = conpoints.conpoint; //this is a second circle - should not be clickable
var st = paper.setFinish();
symbolarray.push(st);
}
Also here's how I make the sets draggable
function dragger(){
this.dx = this.dy = 0;
};
function mover(s){
return function(dx, dy){
(s|| this).translate(dx-this.dx, dy-this.dy);
this.dx = dx;
this.dy = dy;
}
};
for(var i = 0; i<symbolcount;i++){
symbolarray[i].drag(mover(symbolarray[i]), dragger);
}