diff --git a/src/control/Control.Layers.js b/src/control/Control.Layers.js index da4179ef..aab3b2e2 100644 --- a/src/control/Control.Layers.js +++ b/src/control/Control.Layers.js @@ -153,34 +153,34 @@ L.Control.Layers = L.Control.extend({ var form = this._form = L.DomUtil.create('form', className + '-list'); - if (this.options.collapsed) { - if (!L.Browser.android) { - L.DomEvent.on(container, { - mouseenter: this.expand, - mouseleave: this.collapse - }, this); - } - - var link = this._layersLink = L.DomUtil.create('a', className + '-toggle', container); - link.href = '#'; - link.title = 'Layers'; - - if (L.Browser.touch) { - L.DomEvent - .on(link, 'click', L.DomEvent.stop) - .on(link, 'click', this.expand, this); - } 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 () { - setTimeout(L.bind(this._onInputClick, this), 0); + if (!L.Browser.android) { + L.DomEvent.on(container, { + mouseenter: this.expand, + mouseleave: this.collapse }, this); + } - this._map.on('click', this.collapse, this); - // TODO keyboard accessibility + var link = this._layersLink = L.DomUtil.create('a', className + '-toggle', container); + link.href = '#'; + link.title = 'Layers'; + + if (L.Browser.touch) { + L.DomEvent + .on(link, 'click', L.DomEvent.stop) + .on(link, 'click', this.expand, this); } 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 () { + setTimeout(L.bind(this._onInputClick, this), 0); + }, this); + + this._map.on('click', this.collapse, this); + // TODO keyboard accessibility + + if (!this.options.collapsed) { this.expand(); }