From 7b101da036dc0c60fd81785ad49ba18f53f156e7 Mon Sep 17 00:00:00 2001 From: danzel Date: Wed, 30 Oct 2013 09:04:20 +1300 Subject: [PATCH 1/2] Hack fix for firefox android layers control. refs #2033 --- src/control/Control.Layers.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/control/Control.Layers.js b/src/control/Control.Layers.js index c0bcf8e2..11243d5c 100644 --- a/src/control/Control.Layers.js +++ b/src/control/Control.Layers.js @@ -96,6 +96,14 @@ L.Control.Layers = L.Control.extend({ else { L.DomEvent.on(link, 'focus', this._expand, this); } + L.DomEvent.on(form, 'click', function () { + var that = this; + setTimeout(function () { + //alert('l'); + + that._onInputClick(); + }, 0); + }, this); this._map.on('click', this._collapse, this); // TODO keyboard accessibility From b7a6f2aebed43ddda15ffb2214c139544ca0f02e Mon Sep 17 00:00:00 2001 From: danzel Date: Tue, 5 Nov 2013 10:34:35 +1300 Subject: [PATCH 2/2] Comment why this hack exists and improve it with @mourner code :) --- src/control/Control.Layers.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/control/Control.Layers.js b/src/control/Control.Layers.js index 11243d5c..eb039c01 100644 --- a/src/control/Control.Layers.js +++ b/src/control/Control.Layers.js @@ -96,13 +96,9 @@ L.Control.Layers = L.Control.extend({ else { L.DomEvent.on(link, 'focus', this._expand, this); } + //Work around for Firefox android issue https://github.com/Leaflet/Leaflet/issues/2033 L.DomEvent.on(form, 'click', function () { - var that = this; - setTimeout(function () { - //alert('l'); - - that._onInputClick(); - }, 0); + setTimeout(L.bind(this._onInputClick, this), 0); }, this); this._map.on('click', this._collapse, this);