]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.layers.js
Remove sprockets-rails version restriction now konacha is fixed
[rails.git] / app / assets / javascripts / leaflet.layers.js
index 49d19f1235f5cff00ab9c90ce9dc1390f8e5d0c2..9f2e50a6f4afaa928cb6c1611b24843708cabd09 100644 (file)
@@ -34,12 +34,12 @@ L.OSM.layers = function(options) {
       .attr('class', 'section base-layers')
       .appendTo($ui);
 
-    list = $('<ul>')
+    var baseLayers = $('<ul>')
       .appendTo(baseSection);
 
     layers.forEach(function(layer) {
       var item = $('<li>')
-        .appendTo(list);
+        .appendTo(baseLayers);
 
       if (map.hasLayer(layer)) {
         item.addClass('active');
@@ -101,6 +101,8 @@ L.OSM.layers = function(options) {
         map.fire('baselayerchange', {layer: layer});
       });
 
+      item.on('dblclick', toggle);
+
       map.on('layeradd layerremove', function() {
         item.toggleClass('active', map.hasLayer(layer));
         input.prop('checked', map.hasLayer(layer));
@@ -117,7 +119,7 @@ L.OSM.layers = function(options) {
         .attr("class", "deemphasize")
         .appendTo(overlaySection);
 
-      var list = $('<ul>')
+      var overlays = $('<ul>')
         .appendTo(overlaySection);
 
       var addOverlay = function (layer, name, maxArea) {
@@ -125,7 +127,7 @@ L.OSM.layers = function(options) {
           .tooltip({
             placement: 'top'
           })
-          .appendTo(list);
+          .appendTo(overlays);
 
         var label = $('<label>')
           .appendTo(item);