Ignore clicks on history entries if the mouse has moved

Ignore click events on history events if the mouse moves so that
drag selection can work. Fixes #581.
This commit is contained in:
Tom Hughes 2014-03-31 11:25:40 +01:00
parent 5c58f00c2e
commit 883a375d1a

View 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')) {
.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()