Create Leaflet sidebar pane control with header writer fn

This commit is contained in:
Anton Khorev 2022-08-27 20:33:44 +03:00
parent cd5b793dca
commit 8a02bd67d9
5 changed files with 30 additions and 42 deletions

View file

@ -0,0 +1,23 @@
L.OSM.sidebarPane = function (options) {
var control = L.control(options);
control.makeUI = function (uiClass, paneTitle, toggle) {
var $ui = $("<div>")
.attr("class", uiClass);
$("<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)));
return $ui;
};
return control;
};