")
.attr("for", "embed_html")
.attr("href", "#")
.text(I18n.t("javascripts.share.embed")))
.on("click", "a", function (e) {
e.preventDefault();
var id = "#" + $(this).attr("for");
- $linkSection.find(".share-tabs a")
+ $(this).siblings("a")
.removeClass("active");
$(this).addClass("active");
$linkSection.find(".share-tab")
@@ -117,8 +91,7 @@ L.OSM.share = function (options) {
.append(
$("")
.attr("class", "text-muted")
- .text(I18n.t("javascripts.share.paste_html"))
- .appendTo($linkSection));
+ .text(I18n.t("javascripts.share.paste_html")));
// Geo URI
@@ -245,11 +218,15 @@ L.OSM.share = function (options) {
map.on("move", movedMap);
map.on("moveend layeradd layerremove", update);
- options.sidebar.addPane($ui);
-
$ui
+ .on("show", shown)
.on("hide", hidden);
+ function shown() {
+ $("#mapnik_scale").val(getScale());
+ update();
+ }
+
function hidden() {
map.removeLayer(marker);
map.options.scrollWheelZoom = map.options.doubleClickZoom = true;
@@ -257,18 +234,6 @@ L.OSM.share = function (options) {
update();
}
- function toggle(e) {
- e.stopPropagation();
- e.preventDefault();
-
- $("#mapnik_scale").val(getScale());
- marker.setLatLng(map.getCenter());
-
- update();
- options.sidebar.togglePane($ui, button);
- $(".leaflet-control .control-button").tooltip("hide");
- }
-
function toggleMarker() {
if ($(this).is(":checked")) {
marker.setLatLng(map.getCenter());
@@ -413,8 +378,6 @@ L.OSM.share = function (options) {
var precision = 5 * Math.pow(10, Math.floor(Math.LOG10E * Math.log(scale)) - 2);
return precision * Math.ceil(scale / precision);
}
-
- return $container[0];
};
return control;