]> git.openstreetmap.org Git - rails.git/commitdiff
Position Leaflet sidebar close buttons with flex
authorAnton Khorev <tony29@yandex.ru>
Sat, 27 Aug 2022 20:15:04 +0000 (23:15 +0300)
committerAnton Khorev <tony29@yandex.ru>
Sat, 27 Aug 2022 20:15:04 +0000 (23:15 +0300)
app/assets/javascripts/leaflet.sidebar-pane.js

index 2dc3479f2c1ff811b01cc0193408b9a0f8df183e..365a93213b4954b4755c635ba69f43ccd6e41129 100644 (file)
@@ -20,16 +20,15 @@ L.OSM.sidebarPane = function (options, uiClass, buttonTitle, paneTitle) {
     var $ui = $("<div>")
       .attr("class", uiClass + "-ui");
 
     var $ui = $("<div>")
       .attr("class", uiClass + "-ui");
 
-    $("<div>")
-      .attr("class", "sidebar_heading")
+    $("<div class='sidebar_heading d-flex'>")
       .appendTo($ui)
       .appendTo($ui)
-      .append(
-        $("<button type='button' class='btn-close float-end mt-1'>")
+      .append($("<div class='flex-grow-1 text-break'>")
+        .append($("<h4>")
+          .text(I18n.t(paneTitle))))
+      .append($("<div>")
+        .append($("<button type='button' class='btn-close mt-1'>")
           .attr("aria-label", I18n.t("javascripts.close"))
           .attr("aria-label", I18n.t("javascripts.close"))
-          .bind("click", toggle))
-      .append(
-        $("<h4>")
-          .text(I18n.t(paneTitle)));
+          .bind("click", toggle)));
 
     options.sidebar.addPane($ui);
 
 
     options.sidebar.addPane($ui);