hides map controls on mobile screens if sidebar open
This commit is contained in:
@@ -220,6 +220,21 @@ sidebar = L.control.sidebar({
|
|||||||
position: 'left'
|
position: 'left'
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
|
// Hides Map Controls on Mobile while Sidebar is open
|
||||||
|
sidebar.on('content', function () {
|
||||||
|
if (window.innerWidth < 769) {
|
||||||
|
document.querySelectorAll('.leaflet-top.leaflet-right').forEach(function (el) {
|
||||||
|
el.style.display = 'none';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
sidebar.on('closing', function () {
|
||||||
|
document.querySelectorAll('.leaflet-top.leaflet-right').forEach(function (el) {
|
||||||
|
el.style.display = '';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
// =====================================================================
|
// =====================================================================
|
||||||
// Block 6: Geoman Drawing Tools and CRUD Trigger
|
// Block 6: Geoman Drawing Tools and CRUD Trigger
|
||||||
|
|||||||
Reference in New Issue
Block a user