-
Notifications
You must be signed in to change notification settings - Fork 999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor toolbars, add "delete last point" action (fix #229, #236 and probably some others) #242
Conversation
removeToolbar: function () { | ||
L.Toolbar.prototype.removeToolbar.call(this); | ||
|
||
onToolbarRemove: function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, so it doesn't override parent method, but acts as a listener called from it, consistent with onToolbarAdd
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
This is an amazing pull! Thanks so much @Zverik |
I've deployed the patched Leaflet.draw to http://mapbbcode.org — press "Edit" button to see how the new button looks. |
This also fixes css for long action titles, so action buttons do not wrap.