Merge pull request #5087 from Leaflet/layers-collapse-alt

Always create L.Control.Layers as collapsed; expand if collapse option not set
This commit is contained in:
Yohan Boniface
2016-11-11 16:15:49 +01:00
committed by GitHub
2 changed files with 37 additions and 25 deletions

View File

@ -128,4 +128,16 @@ describe("Control.Layers", function () {
});
});
describe("is created with an expand link", function () {
it("when collapsed", function () {
var layersCtrl = L.control.layers(null, null, {collapsed: true}).addTo(map);
expect(map._container.querySelector('.leaflet-control-layers-toggle')).to.be.ok();
});
it("when not collapsed", function () {
var layersCtrl = L.control.layers(null, null, {collapsed: false}).addTo(map);
expect(map._container.querySelector('.leaflet-control-layers-toggle')).to.be.ok();
});
});
});