]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.key.js
Simplify sidebar/resize
[rails.git] / app / assets / javascripts / leaflet.key.js
index 9fe457851f35dad9ed907a36a1fe65bb44875e19..d12187bc2f80581ba5f42d9120c3f0abee31bcf3 100644 (file)
@@ -14,11 +14,20 @@ L.OSM.key = function (options) {
       .appendTo($container);
 
     var $ui = $('<div>')
-      .attr('class', 'layers-ui');
+      .attr('class', 'key-ui');
 
-    $('<h2>')
-      .text(I18n.t('javascripts.key.title'))
-      .appendTo($ui);
+    $('<header>')
+      .attr('class', 'sidebar_heading')
+      .appendTo($ui)
+      .append(
+        $('<a>')
+          .text(I18n.t('javascripts.close'))
+          .attr('class', 'sidebar_close')
+          .attr('href', '#')
+          .bind('click', toggle))
+      .append(
+        $('<h4>')
+          .text(I18n.t('javascripts.key.title')));
 
     var $section = $('<section>')
       .appendTo($ui);
@@ -45,7 +54,7 @@ L.OSM.key = function (options) {
     }
 
     function update() {
-      var layer = getMapBaseLayerId(map),
+      var layer = map.getMapBaseLayerId(),
         zoom = map.getZoom();
 
       $('.mapkey-table-entry').each(function () {