Merge pull request #3564 from rowanwins/layerControlFix

Fix for issue #2771
This commit is contained in:
Vladimir Agafonkin 2015-06-30 13:19:03 +03:00
commit 7e45690169

View File

@ -198,8 +198,13 @@ L.Control.Layers = L.Control.extend({
var name = document.createElement('span'); var name = document.createElement('span');
name.innerHTML = ' ' + obj.name; name.innerHTML = ' ' + obj.name;
label.appendChild(input); // Helps from preventing layer control flicker when checkboxes are disabled
label.appendChild(name); // https://github.com/Leaflet/Leaflet/issues/2771
var holder = document.createElement('div');
label.appendChild(holder);
holder.appendChild(input);
holder.appendChild(name);
var container = obj.overlay ? this._overlaysList : this._baseLayersList; var container = obj.overlay ? this._overlaysList : this._baseLayersList;
container.appendChild(label); container.appendChild(label);