Remove marker and filter when closed
authorJohn Firebaugh <john.firebaugh@gmail.com>
Fri, 19 Jul 2013 19:18:25 +0000 (12:18 -0700)
committerJohn Firebaugh <john.firebaugh@gmail.com>
Mon, 5 Aug 2013 15:31:45 +0000 (08:31 -0700)
app/assets/javascripts/leaflet.share.js

index d55b0bbd9ffea032d2d38fee65b173c379f406c4..a9fe4dccf91bbeef9da7181c6584c698e35d52c6 100644 (file)
@@ -204,6 +204,15 @@ L.OSM.share = function (options) {
 
     options.sidebar.addPane($ui);
 
+    $ui
+      .on('hide', hidden);
+
+    function hidden() {
+      map.removeLayer(marker);
+      locationFilter.disable();
+      update();
+    }
+
     function toggle(e) {
       e.stopPropagation();
       e.preventDefault();