]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.sidebar-pane.js
Make close buttons stick to the top of scrolled areas
[rails.git] / app / assets / javascripts / leaflet.sidebar-pane.js
index 06fad7b66dfd4f44bc0c63fe6ae3fdf3ff304f29..7408585f26adbd19dfd1f57d3d87fd49c16fab6e 100644 (file)
@@ -18,16 +18,11 @@ L.OSM.sidebarPane = function (options, uiClass, buttonTitle, paneTitle) {
     button.appendTo($container);
 
     const $ui = $("<div>")
-      .attr("class", uiClass + "-ui");
-
-    $("<div class='d-flex p-3 pb-0'>")
-      .appendTo($ui)
-      .append($("<h2 class='flex-grow-1 text-break'>")
-        .text(I18n.t(paneTitle)))
-      .append($("<div>")
-        .append($("<button type='button' class='btn-close'>")
-          .attr("aria-label", I18n.t("javascripts.close"))
-          .bind("click", toggle)));
+      .attr("class", `${uiClass}-ui position-relative z-n1`);
+
+    $("<h2 class='p-3 pb-0 pe-5 text-break'>")
+      .text(I18n.t(paneTitle))
+      .appendTo($ui);
 
     options.sidebar.addPane($ui);