Opened 16 years ago

Closed 15 years ago

#1683 closed enhancement (wontfix)

Expose dragObject's absolute position

Reported by: [email protected] Owned by: Eugene Lazutkin
Priority: high Milestone: 0.9
Component: DnD Version: 0.3
Keywords: dnd dragObject absolute position Cc:
Blocked By: Blocking:


It is useful to know the distance an object has been dragged (for example, using dragging to pan around an image). It would be nice to have a method to obtain these coordinates from the dragObject.

The following snippet works fine, but since dragClone is not in the dnd API, it might eventually break:

var drag = new dojo.dnd.HtmlDragSource(someDiv, "someDiv");
var target = new dojo.dnd.HtmlDropTarget(otherDiv, ["someDiv"])
dojo.event.connect(drag, "onDragEnd", "showXY");

function showXY (dragEvt) {
  alert([dojo.html.getAbsoluteX(dragEvt.dragObject.dragClone), dojo.html.getAbsoluteY(dragEvt.dragObject.dragClone)]);

Change History (3)

comment:1 Changed 16 years ago by alex

Milestone: 0.5
Owner: changed from psowden to alex
Status: newassigned

comment:2 Changed 15 years ago by Adam Peller

Owner: changed from alex to Eugene Lazutkin
Status: assignednew

comment:3 Changed 15 years ago by Eugene Lazutkin

Resolution: wontfix
Status: newclosed

This functionality can be implemented in the user's code in 0.9.

Note: See TracTickets for help on using tickets.