Tobi
unread,Aug 20, 2009, 6:44:51 AM8/20/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Raphaël
Hi!
First of all this library looks amazing, thank you!
I am trying to create a simple browser based workflow editor. The
Graffle demo looks fantastic and almost like what I am looking for,
except that the drag event handler only references the object that has
been clicked on.
I want to move more than one object at a time, i.e. a rectangle that I
am attaching the event to plus other items (text and image) inside the
rectangle.
So by attaching the dragger event to the rect ...
box = r.rect(150, 150, 120, 40, 10);
box.node.style.cursor = "move";
box.mousedown(dragger);
========================
var dragger = function (e) {
isDrag = this;
isDrag.dx = e.clientX;
isDrag.dy = e.clientY;
isDrag.animate({"fill-opacity": .2}, 500);
e.preventDefault && e.preventDefault();
};
The passed event e only references the source of the click (one single
element), but I want to move not only a single rectangle but also
items within it.
I tried using sets but the event still only picks up the item that has
been clicked on (even if the event is attached to the whole set).
I thought of creating a custom rect that references the items inside
and attaching the event to it so that i can just move the referenced
items together with the rect, but is there a better way?
Somehow I think I am making things more complicated as they are.
Thanks a lot!
Tobi.