diff --git a/inst/htmlwidgets/lfx-sidebar/leaflet-sidebar-binding.js b/inst/htmlwidgets/lfx-sidebar/leaflet-sidebar-binding.js
index 5aba1d11..8ab3b0b9 100644
--- a/inst/htmlwidgets/lfx-sidebar/leaflet-sidebar-binding.js
+++ b/inst/htmlwidgets/lfx-sidebar/leaflet-sidebar-binding.js
@@ -9,7 +9,6 @@ LeafletWidget.methods.addSidebar = function(id, options) {
}
// Move Sidebar inside Map-Div
- /*var mapid = "#"+map.id*/
var mapid = "#" + (map.id ? map.id : map._container.id);
if (options && options.fit === true) {
// Append sidebar container to map div
@@ -74,14 +73,10 @@ LeafletWidget.methods.removeSidebar = function(sidebar_id) {
var sidebar = $(`#${tid}`);
if (sidebar[0]) {
// Remove left/right CSS
- if (L.DomUtil.hasClass(sidebar[0], 'leafsidebar-left')) {
- $('.sidebar-map .leaflet-left').css('left', 0);
- } else {
- $('.sidebar-map .leaflet-right').css('right', 0);
- }
+ map._container.classList.remove("sidebar-map")
// Remove Sidebar and Delete from map
sidebar.remove();
- $(".leaflet-sidebar-container").remove();
+ $("#" + map.id + " .leaflet-sidebar-container").remove();
delete map.sidebar[tid];
}
}
diff --git a/inst/htmlwidgets/lfx-sidebar/leaflet-sidebar.css b/inst/htmlwidgets/lfx-sidebar/leaflet-sidebar.css
index 76fd1675..139ad163 100644
--- a/inst/htmlwidgets/lfx-sidebar/leaflet-sidebar.css
+++ b/inst/htmlwidgets/lfx-sidebar/leaflet-sidebar.css
@@ -144,10 +144,10 @@
}
.sidebar-map .leaflet-left {
- left: 40px;
+ left: 40px !important;
}
.sidebar-map .leaflet-right {
- right: 40px;
+ right: 40px !important;
}
.leafsidebar.leaflet-touch {