if (queryButton.hasClass("disabled")) return;
if (queryButton.hasClass("active")) {
- disableQueryMode();
-
- OSM.router.route("/");
+ if ($("#content").hasClass("overlay-sidebar")) {
+ disableQueryMode();
+ }
} else {
enableQueryMode();
}
if (geometry) map.removeLayer(geometry);
$(this).removeClass("selected");
})
- .on("click", ".query-results li.query-result", function (e) {
- if (!$(e.target).is('a')) {
- $(this).find("a").simulate("click", e);
- }
+ .on("mousedown", ".query-results li.query-result", function (e) {
+ var moved = false;
+ $(this).one("click", function (e) {
+ if (!moved) {
+ var geometry = $(this).data("geometry")
+ if (geometry) map.removeLayer(geometry);
+
+ if (!$(e.target).is('a')) {
+ $(this).find("a").simulate("click", e);
+ }
+ }
+ }).one("mousemove", function () {
+ moved = true;
+ });
});
function interestingFeature(feature, origin, radius) {