L.OSM.key = function (options) {
- var control = L.control(options);
+ var control = L.OSM.sidebarPane(options);
control.onAdd = function (map) {
var $container = $("<div>")
.attr("class", "control-key");
- var button = $("<a>")
- .attr("class", "control-button")
- .attr("href", "#")
- .html("<span class=\"icon key\"></span>")
- .on("click", toggle)
+ var button = this.makeButton("key", null, toggle)
.appendTo($container);
- var $ui = $("<div>")
- .attr("class", "key-ui");
-
- $("<div>")
- .attr("class", "sidebar_heading")
- .appendTo($ui)
- .append(
- $("<span>")
- .text(I18n.t("javascripts.close"))
- .attr("class", "icon close")
- .bind("click", toggle))
- .append(
- $("<h4>")
- .text(I18n.t("javascripts.key.title")));
+ var $ui = this.makeUI("key-ui", "javascripts.key.title", toggle);
var $section = $("<div>")
.attr("class", "section")