1 L.OSM.sidebarPane = function (options, uiClass, buttonTitle, paneTitle) {
2 var control = L.control(options);
4 control.onAdd = function (map) {
5 var $container = $("<div>")
6 .attr("class", "control-" + uiClass);
9 .attr("class", "control-button")
11 .html("<span class=\"icon " + uiClass + "\"></span>")
15 button.attr("title", I18n.t(buttonTitle));
18 button.appendTo($container);
21 .attr("class", uiClass + "-ui");
23 $("<div class='sidebar_heading d-flex'>")
25 .append($("<h4 class='flex-grow-1 text-break'>")
26 .text(I18n.t(paneTitle)))
28 .append($("<button type='button' class='btn-close'>")
29 .attr("aria-label", I18n.t("javascripts.close"))
30 .bind("click", toggle)));
32 options.sidebar.addPane($ui);
34 this.onAddPane(map, button, $ui, toggle);
39 if (!button.hasClass("disabled")) {
40 options.sidebar.togglePane($ui, button);
42 $(".leaflet-control .control-button").tooltip("hide");
48 // control.onAddPane = function (map, button, $ui, toggle) {