From 6fbc531c17e6228f82cca5a033931fe5dcde38dc Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 30 Dec 2015 08:21:46 +0100 Subject: [PATCH] map: fix coord picker on first click --- lib/map.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/map.js b/lib/map.js index d2aaf4a..ea40998 100644 --- a/lib/map.js +++ b/lib/map.js @@ -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) }