Don't try and add a note when the control is disabled
authorTom Hughes <tom@compton.nu>
Tue, 4 Dec 2012 14:31:08 +0000 (14:31 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 4 Dec 2012 14:31:08 +0000 (14:31 +0000)
app/assets/javascripts/index/notes.js.erb

index eecf91ef0d31862b1152c055654d35ca0a0ad7da..c4f75848279f29e931ac37f6beb43ae0c2cc43d9 100644 (file)
@@ -174,6 +174,8 @@ $(document).ready(function () {
   $("#createnoteanchor").click(function (e) {
     e.preventDefault();
 
+    if ($(e.target).hasClass("disabled")) return;
+
     map.addLayer(noteLayer);
 
     var marker = L.marker(map.getCenter(), {