Refactor toolbars, add "delete last point" action (fix #229, #236 and probably some others) #242

merged 6 commits into from Dec 19, 2013


None yet
2 participants

Zverik commented Dec 10, 2013

This also fixes css for long action titles, so action buttons do not wrap.

@jacobtoye jacobtoye commented on the diff Dec 15, 2013

- removeToolbar: function () {
+ onToolbarRemove: function () {

jacobtoye Dec 15, 2013


Is there a reason for this change?


Zverik Dec 16, 2013


Yes, so it doesn't override parent method, but acts as a listener called from it, consistent with onToolbarAdd.


jacobtoye Dec 18, 2013


Yeah I was more meaning why do it this way rather than override the parent method and call L.Toolbar.prototype.addToolbar. If it is just a style choice that's fine.


Zverik Dec 18, 2013


Well, overriding a methods means you have to understand how parent method works and not forget to call it properly. Listener method is an API, which means it have clearly defined input and output that can be documented somewhere. The less stuff need to be overridden — the better.


jacobtoye commented Dec 15, 2013

This is an amazing pull! Thanks so much @Zverik


Zverik commented Dec 17, 2013

I've deployed the patched Leaflet.draw to — press "Edit" button to see how the new button looks.

@jacobtoye jacobtoye added a commit that referenced this pull request Dec 19, 2013

@jacobtoye jacobtoye Merge pull request #242 from Zverik/undo
Refactor toolbars, add "delete last point" action (fix #229, #236 and probably some others)

@jacobtoye jacobtoye merged commit 298eee8 into Leaflet:master Dec 19, 2013

Zverik deleted the Zverik:undo branch Dec 19, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment