]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.sidebar-pane.js
Move getDistText next to other formatting functions
[rails.git] / app / assets / javascripts / leaflet.sidebar-pane.js
index 2dc3479f2c1ff811b01cc0193408b9a0f8df183e..7408585f26adbd19dfd1f57d3d87fd49c16fab6e 100644 (file)
@@ -1,35 +1,28 @@
 L.OSM.sidebarPane = function (options, uiClass, buttonTitle, paneTitle) {
-  var control = L.control(options);
-  
+  const control = L.control(options);
+
   control.onAdd = function (map) {
-    var $container = $("<div>")
+    const $container = $("<div>")
       .attr("class", "control-" + uiClass);
 
-    var button =  $("<a>")
+    const 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));
     }
 
     button.appendTo($container);
 
-    var $ui = $("<div>")
-      .attr("class", uiClass + "-ui");
+    const $ui = $("<div>")
+      .attr("class", `${uiClass}-ui position-relative z-n1`);
 
-    $("<div>")
-      .attr("class", "sidebar_heading")
-      .appendTo($ui)
-      .append(
-        $("<button type='button' class='btn-close float-end mt-1'>")
-          .attr("aria-label", I18n.t("javascripts.close"))
-          .bind("click", toggle))
-      .append(
-        $("<h4>")
-          .text(I18n.t(paneTitle)));
+    $("<h2 class='p-3 pb-0 pe-5 text-break'>")
+      .text(I18n.t(paneTitle))
+      .appendTo($ui);
 
     options.sidebar.addPane($ui);
 
@@ -45,7 +38,7 @@ L.OSM.sidebarPane = function (options, uiClass, buttonTitle, paneTitle) {
     }
 
     return $container[0];
-  }
+  };
 
   // control.onAddPane = function (map, button, $ui, toggle) {
   // }