Create pane button fn

This commit is contained in:
Anton Khorev 2022-08-27 20:54:37 +03:00
parent 8a02bd67d9
commit 71e7208a0a
4 changed files with 17 additions and 17 deletions

View file

@ -1,6 +1,20 @@
L.OSM.sidebarPane = function (options) {
var control = L.control(options);
control.makeButton = function (buttonClass, buttonTitle, toggle) {
var button = $("<a>")
.attr("class", "control-button")
.attr("href", "#")
.html("<span class=\"icon " + buttonClass + "\"></span>")
.on("click", toggle);
if (buttonTitle) {
button.attr("title", I18n.t(buttonTitle))
}
return button;
};
control.makeUI = function (uiClass, paneTitle, toggle) {
var $ui = $("<div>")
.attr("class", uiClass);