Open joeyh opened 7 years ago
This looks very reasonable to me. Can you give your approval, @HeinrichApfelmus?
CI may fail but this builds fine on my machine.
I think what's missing is that ClientXY
should be exported?!
Getting X and Y coordinates from a drag event seems useful.
However, there are two issues with this implementation:
It turns out that clientX/Y
is relative to the top-left corner of the display in the browser, but this need not coincide with the top-left corner of the HTML page if the use has scrolled the page vertically! We use
var offset = $(this).offset();
var x = e.pageX - offset.left;
for the mouse click events, but I do not know if we can obtain offset
in the same way for drag events.
read
and toString()
is unsatisfactory. We can marshal JSON values, so it would be more appropriate to express the argument to fun
as a JSON value and read its fields on the Haskell side.I'm happy to look into this if no one else calls dibs, but it may take another day or two.
Available in all drag and drop events except for dragEnd.
Closes https://github.com/HeinrichApfelmus/threepenny-gui/issues/189