]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.note.js
Fix undefined=undefined in query strings
[rails.git] / app / assets / javascripts / leaflet.note.js
index 14a33640ace6c89f35b6a5f8aa1307673d171836..77fb9baff90f3afc6936dfdd7d4a599fda8daf30 100644 (file)
@@ -1,27 +1,19 @@
-L.Control.Note = L.Control.extend({
-    options: {
-        position: 'topright',
-        title: 'Notes',
-    },
+L.OSM.note = function (options) {
+  var control = L.control(options);
 
 
-    onAdd: function (map) {
-        var className = 'leaflet-control-locate',
-            classNames = className + ' leaflet-control-zoom leaflet-bar leaflet-control',
-            container = L.DomUtil.create('div', classNames);
+  control.onAdd = function (map) {
+    var $container = $('<div>')
+      .attr('class', 'control-note');
 
 
-        var link = L.DomUtil.create('a', 'leaflet-bar-part leaflet-bar-part-single', container);
-        link.href = '#';
-        link.title = this.options.title;
+    $('<a>')
+      .attr('class', 'control-button')
+      .attr('href', '#')
+      .attr('title', I18n.t('javascripts.notes.new.add'))
+      .html('<span class="icon note"></span>')
+      .appendTo($container);
 
 
-        L.DomEvent
-            .on(link, 'click', L.DomEvent.stopPropagation)
-            .on(link, 'click', L.DomEvent.preventDefault)
-            .on(link, 'dblclick', L.DomEvent.stopPropagation);
+    return $container[0];
+  };
 
 
-        return container;
-    }
-});
-
-L.control.note = function(options) {
-    return new L.Control.Note(options);
+  return control;
 };
 };