map: fix coord picker on first click

This commit is contained in:
Jonas Platte 2015-12-30 08:21:46 +01:00 committed by Milan Pässler
parent f9e8c72508
commit 6fbc531c17

View file

@ -85,7 +85,8 @@ define(["map/clientlayer", "map/labelslayer",
var button = L.DomUtil.create("button", "coord-picker")
button.textContent = ""
L.DomEvent.disableClickPropagation(button)
// Click propagation isn't disabled as this causes problems with the
// location picking mode; instead propagation is stopped in onClick().
L.DomEvent.addListener(button, "click", this.onClick, this)
this.button = button
@ -102,7 +103,8 @@ define(["map/clientlayer", "map/labelslayer",
this.update()
},
onClick: function () {
onClick: function (e) {
L.DomEvent.stopPropagation(e)
this.f(!this.active)
}