How does eventData work?
#3043
-
IntroductionHi, Could you please explain how E.g. I can Two different events, yet they share the data. How is this achieved? Yet, if I extend the Connect tool and add e.g. a random event: this.events = {
....
mouseenter: "mouseenter",
};
// let's assume this executes while the the mouse button is held down;
// no access to `linkView` in the method either
mouseenter( e ) {
this.relatedView.eventData(e, { randomData: true });
}... this data will be only added to the Thank you. Does your question relate to JointJS or JointJS+. Select both if applicable.JointJS, JointJS+ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Only consecutive It's a feature we preserved when migrating from jQuery. When the user starts dragging an element ( function onPointerDown() {
const data = {};
paper.$el.on('pointermove', '.joint-element', data, onPointerMove);
paper.$el.on('pointerup', '.joint-element', data, onPointerUp);
} |
Beta Was this translation helpful? Give feedback.
Only consecutive
pointerdown,pointermoveandpointerupevents can share information through theevt.dataobject. See docs.It's a feature we preserved when migrating from jQuery.
When the user starts dragging an element (
pointerdown), we attachpointermoveandpointeruplisteners and make them share thedataobject.