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

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
5 participants
Member

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.

Owner

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.

Thoughts?

Contributor

Starefossen commented May 30, 2013

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

Member

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 <
notifications@github.com> wrote:

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


Reply to this email directly or view it on GitHubhttps://github.com/Leaflet/Leaflet.draw/pull/136#issuecomment-18691371
.

Owner

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.

Member

snkashis commented May 31, 2013

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

Contributor

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".

Owner

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