]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/history.js
Ignore clicks on history entries if the mouse has moved
[rails.git] / app / assets / javascripts / index / history.js
index 8103f047ed5d054e29c0a65fb27c2654150a965b..cb1f6f8d576012680ee051dddc4a222194d98397 100644 (file)
@@ -11,10 +11,15 @@ OSM.History = function(map) {
     .on("mouseout", "[data-changeset]", function () {
       unHighlightChangeset($(this).data("changeset").id);
     })
-    .on("click", "[data-changeset]", function (e) {
-      if (!$(e.target).is('a')) {
-        clickChangeset($(this).data("changeset").id, e);
-      }
+    .on("mousedown", "[data-changeset]", function () {
+      var moved = false;
+      $(this).one("click", function (e) {
+        if (!moved && !$(e.target).is('a')) {
+          clickChangeset($(this).data("changeset").id, e);
+        }
+      }).one("mousemove", function () {
+        moved = true;
+      });
     });
 
   var group = L.featureGroup()