Edit/delete handler bug. #247

Merged
merged 4 commits into from Dec 19, 2013

Projects

None yet

2 participants

@manubb
Contributor
manubb commented Dec 18, 2013

First commit:
When in edit/delete mode, revertLayers has to be called when another handler is clicked on.

To reproduce in http://leaflet.github.io/Leaflet.draw/
-Draw two markers
-Delete one but do not click save/cancel
-Click edit button.

The marker is deleted even though the change was not saved.

Second commit:
-draw:deletestart and draw:deletestop are fired in delete handler instead of draw:editstart and draw:editstop.
-enable and disable functions are reshaped so that a handler cannot be activated while the other is still active.

This is useful when drawLayer has to be updated in some way when entering delete mode and in another way when entering edit mode.

manubb added some commits Dec 18, 2013
@manubb manubb When in edit/delete mode, revertLayers has to be called
when another handler is clicked on.
61c9841
@manubb manubb Reorder code that enable/disable edt/delete handlers.
Add draw:deletestart and draw:deletestop events.
bb4d474
Owner

Awesome!

One small issue, could you please pull in the Leaflet.draw upstream to get all changes in the last 3 months so this PR can be automatically merged. There might be conflicts since you fork is out of date.

@jacobtoye jacobtoye merged commit 8ff11e9 into Leaflet:master Dec 19, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment