]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.share.js
Create Leaflet sidebar pane control with header writer fn
[rails.git] / app / assets / javascripts / leaflet.share.js
index 79cb959732211750a7b517a07f44b9e4e77c14ad..875008cfc7450bab96deb64b0c3d8c20f52de8b2 100644 (file)
@@ -1,5 +1,5 @@
 L.OSM.share = function (options) {
-  var control = L.control(options),
+  var control = L.OSM.sidebarPane(options),
       marker = L.marker([0, 0], { draggable: true }),
       locationFilter = new L.LocationFilter({
         enableButton: false,
@@ -18,20 +18,7 @@ L.OSM.share = function (options) {
       .on("click", toggle)
       .appendTo($container);
 
-    var $ui = $("<div>")
-      .attr("class", "share-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.share.title")));
+    var $ui = this.makeUI("share-ui", "javascripts.share.title", toggle);
 
     // Link / Embed
 
@@ -47,7 +34,7 @@ L.OSM.share = function (options) {
       .appendTo($linkSection);
 
     $("<div>")
-      .attr("class", "form-check form-group")
+      .attr("class", "form-check mb-3")
       .appendTo($form)
       .append(
         $("<label>")
@@ -159,7 +146,7 @@ L.OSM.share = function (options) {
       .appendTo($imageSection);
 
     $("<div>")
-      .attr("class", "form-group form-check")
+      .attr("class", "mb-3 form-check")
       .appendTo($form)
       .append(
         $("<label>")