Volodymyr Agafonkin
Volodymyr Agafonkin
Another option to try is having a transparent empty div with the cursor set over everything while you drag. In theory it shouldn't cause relayout of all other elements, but...
@danzel I remember using this initially, but eventually switched to document as setting cursor on the element introduced some undesirable cursor effects, such as cursor jumping back and forth when...
Hmm, perhaps it was like that with draggable markers...
OK, fiddled with this a bit today and the pull is generally an improvement indeed, although there's a small glitch with draggable markers β if you drag a marker close...
@danzel so the `e.target` thing doesn't work on maps with vector layers because `L.DomUtil.add/removeClass` doesn't work on SVG elements. I'll look into patching it...
OK patched `DomUtil.add/removeClass` to work with SVG elements (and improve their perf significantly with `classList`)! @danzel now we can patch `Draggable` to only set the cursor on `e.target`, but lets...
Oops, except maybe IE9, which doesn't support `classList`, damn! http://caniuse.com/#search=classlist But maybe IE9 will be fine setting `el.className`, I'm not sure β it would be nice to check just in...
@klimashkin nice tips, but it's not used that often to have any difference.
@danzel OK fixed the IE9 issue (in theory).
That's weird, it wasn't affecting performance in my tests... Will check again.