]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.sidebar-pane.js
Merge remote-tracking branch 'upstream/pull/3705'
[rails.git] / app / assets / javascripts / leaflet.sidebar-pane.js
index 2dc3479f2c1ff811b01cc0193408b9a0f8df183e..d8213a3767a948aee2c0a9cdadc5498cbf1d4208 100644 (file)
@@ -1,16 +1,16 @@
 L.OSM.sidebarPane = function (options, uiClass, buttonTitle, paneTitle) {
   var control = L.control(options);
-  
+
   control.onAdd = function (map) {
     var $container = $("<div>")
       .attr("class", "control-" + uiClass);
 
-    var button =  $("<a>")
+    var button = $("<a>")
       .attr("class", "control-button")
       .attr("href", "#")
       .html("<span class=\"icon " + uiClass + "\"></span>")
       .on("click", toggle);
-    
+
     if (buttonTitle) {
       button.attr("title", I18n.t(buttonTitle));
     }
@@ -20,16 +20,14 @@ L.OSM.sidebarPane = function (options, uiClass, buttonTitle, paneTitle) {
     var $ui = $("<div>")
       .attr("class", uiClass + "-ui");
 
-    $("<div>")
-      .attr("class", "sidebar_heading")
+    $("<div class='sidebar_heading d-flex'>")
       .appendTo($ui)
-      .append(
-        $("<button type='button' class='btn-close float-end mt-1'>")
+      .append($("<h4 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))
-      .append(
-        $("<h4>")
-          .text(I18n.t(paneTitle)));
+          .bind("click", toggle)));
 
     options.sidebar.addPane($ui);
 
@@ -45,7 +43,7 @@ L.OSM.sidebarPane = function (options, uiClass, buttonTitle, paneTitle) {
     }
 
     return $container[0];
-  }
+  };
 
   // control.onAddPane = function (map, button, $ui, toggle) {
   // }