owncloud-archive / maps

:globe_with_meridians: Maps app for ownCloud
GNU Affero General Public License v3.0
42 stars 20 forks source link

Open Popup on hover #106

Closed v1r0x closed 8 years ago

v1r0x commented 8 years ago

fixes #105

This PR opens/closes the popup on hover. It stays open if the user hovers over the popup. If the user hover only over the marker the popup will close (on mouseout).

Works good for me, except a js TypeError. Don't know why...

What do you think (except the error), @jancborchardt ?

jancborchardt commented 8 years ago

It stays open if the user hovers over the popup.

Nice behavior, good call!

However there’s one strange behavior: When you hover a marker, the popup opens. When you then click it (this can happen directly after the hover because ppl might be used to it), the popup closes. It should then be permanently open though, just like when hovering the popup itself.

Also, can you then change the POI popup to show on single click instead of long click?

v1r0x commented 8 years ago

The easiest way would be to deactivate close on marker click completely. This also seems to be a comprehensible behaviour.

Yes, should be easy to modify.

jancborchardt commented 8 years ago

True, let’s try with closing on marker click deactivated. The close cross should suffice.

v1r0x commented 8 years ago

Seems that this is not possible without modifying the leaflet source...The best I could get was a reopen of the popup. I'll commit it so you can test it.

jancborchardt commented 8 years ago

After a bit of testing, it seems that not messing with the click event makes it smoother. So 11f9941 can be reverted. :)

However one thing is strange and feels glitchy: Hovering over the marker, the popup shows. Then moving across to the popup makes the popup flash once. Can we get rid of that?

(Also another thing, but probably for a future pull request: When single-clicking somewhere, sure the data for the POI has to be loaded first until the popup can be shown. But the place marker should immediately be displayed for fast feedback.)

v1r0x commented 8 years ago

However one thing is strange and feels glitchy: Hovering over the marker, the popup shows. Then moving across to the popup makes the popup flash once. Can we get rid of that?

Havn't noticed this. I'll test it later and (if it exists for me) try to fix it.

(Also another thing, but probably for a future pull request: When single-clicking somewhere, sure the data for the POI has to be loaded first until the popup can be shown. But the place marker should immediately be displayed for fast feedback.

Should be easy to fix, maybe just one line of code. So no separate PR, in my opinion. :)

v1r0x commented 8 years ago

I could not reproduce the popup flash. But adding the marker immediately after the click should work.

jancborchardt commented 8 years ago

Ok, let's merge and fix additional stuff going forward. :)