Fix P2 interaction with search links

Need to prevent the default action so that the page isn't
reloaded.

Also, since the click event binding uses delegation, it isn't
necessary to wrap it in $(document).ready().
This commit is contained in:
John Firebaugh 2013-04-18 15:59:25 -07:00 committed by Tom Hughes
parent 47a75be1c7
commit 66ce4c3b93

View file

@ -71,13 +71,13 @@
doSWF(params.lat, params.lon, params.zoom || 17); doSWF(params.lat, params.lon, params.zoom || 17);
<% end -%> <% end -%>
$(document).ready(function () { $("body").on("click", "a.set_position", function (e) {
$("body").on("click", "a.set_position", function () { e.preventDefault();
var data = $(this).data();
$("#potlatch").each(function () { var data = $(this).data();
this.setPosition(data.lat, data.lon, Math.max(data.zoom || 15, 13));
}); $("#potlatch").each(function () {
this.setPosition(data.lat, data.lon, Math.max(data.zoom || 15, 13));
}); });
}); });