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

Merged
merged 6 commits into from Dec 19, 2013

Conversation

Projects
None yet
2 participants
Contributor

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

src/edit/EditToolbar.js
},
- removeToolbar: function () {
- L.Toolbar.prototype.removeToolbar.call(this);
-
+ onToolbarRemove: function () {
@jacobtoye

jacobtoye Dec 15, 2013

Owner

Is there a reason for this change?

@Zverik

Zverik Dec 16, 2013

Contributor

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

@jacobtoye

jacobtoye Dec 18, 2013

Owner

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

Zverik Dec 18, 2013

Contributor

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.

Owner

jacobtoye commented Dec 15, 2013

This is an amazing pull! Thanks so much @Zverik

Contributor

Zverik commented Dec 17, 2013

I've deployed the patched Leaflet.draw to http://mapbbcode.org — 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)
298eee8

@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