1 L.OSM.sidebarPane = function (options, uiClass, buttonTitle, paneTitle) {
 
   2   const control = L.control(options);
 
   4   control.onAdd = function (map) {
 
   5     const $container = $("<div>")
 
   6       .attr("class", "control-" + uiClass);
 
   8     const button = $("<a>")
 
   9       .attr("class", "control-button")
 
  11       .attr("title", OSM.i18n.t(buttonTitle))
 
  14     $(L.SVG.create("svg"))
 
  15       .append($(L.SVG.create("use")).attr("href", "#icon-" + uiClass))
 
  16       .attr("class", "h-100 w-100")
 
  19     button.appendTo($container);
 
  21     const $ui = $("<div>")
 
  22       .attr("class", `${uiClass}-ui position-relative z-n1`);
 
  24     $("<h2 class='p-3 pb-0 pe-5 text-break'>")
 
  25       .text(OSM.i18n.t(paneTitle))
 
  28     options.sidebar.addPane($ui);
 
  30     this.loadContent = () =>
 
  31       fetch("/panes/" + uiClass)
 
  33         .then(html => { $(html).appendTo($ui); })
 
  34         .then(this.onContentLoaded);
 
  36     this.onAddPane(map, button, $ui, toggle);
 
  41       if (!button.hasClass("disabled")) {
 
  42         options.sidebar.togglePane($ui, button);
 
  44       $(".leaflet-control .control-button").tooltip("hide");
 
  50   // control.onAddPane = function (map, button, $ui, toggle) {