Don't enter delete or edit modes if no layers are available #136

wants to merge 3 commits into


None yet
5 participants

snkashis commented May 3, 2013

I thought it was a bit odd that you could enter the delete and edit modes and see the tooltip+save/cancel buttons, even if there was nothing available to use them on. This prevents that.


jacobtoye commented May 21, 2013

I'm inclined to think that it should enter edit mode, if only to show the user that something happened. It would be quite strange if the user clicked a button and nothing happened. I don't think it is Leaflet.draw's place to show an error either.



Starefossen commented May 30, 2013

What about disabling the buttons (greyed out) until there is something to edit/delete?!


snkashis commented May 30, 2013

I think that makes a lot of sense, and better than my original pull.

On Thu, May 30, 2013 at 12:21 PM, Hans Kristian Flaatten <> wrote:

What about disabling the buttons (greyed out) until there is something to

Reply to this email directly or view it on GitHub


jacobtoye commented May 30, 2013

Yeah that's a good idea @Starefossen :) Should be pretty simple to implement. Have a css class for disabled state and set it when the handler is enabled.


snkashis commented May 31, 2013

Okay, just added that in. Watches created and deleted events.


cazacugmihai commented Sep 24, 2013

+1 for this fix. Why is still not merged?

+1. Perhaps also a tooltip when you hover saying "No items to edit".


jacobtoye commented Sep 30, 2013

Thanks for the work @snkashis. I've implemented this a bit differently so closing this pull.

@jacobtoye jacobtoye closed this Sep 30, 2013

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