Fix issues with clicking place when place popup open (close #16)
This commit is contained in:
parent
c3c7599be8
commit
7864cf2ccb
@ -90,10 +90,12 @@ function scanCode() {
|
||||
}
|
||||
|
||||
function openPlace(id, name) {
|
||||
var placepopupnonce = Math.random();
|
||||
$("#place-info").addClass("display-none");
|
||||
$("#place-error-msg").addClass("display-none");
|
||||
$("#place-popup .preloader").removeClass("display-none");
|
||||
$("#place-popup").data("placeid", id);
|
||||
$("#place-popup").data("placepopupnonce", placepopupnonce);
|
||||
$("#place-title").text(name);
|
||||
app.popup.open("#place-popup");
|
||||
|
||||
@ -107,6 +109,14 @@ function openPlace(id, name) {
|
||||
});
|
||||
|
||||
var refreshPlaceStats = function () {
|
||||
if (id != $("#place-popup").data("placeid")) {
|
||||
console.log("refreshPlaceStats: place ID changed, stopping refresh");
|
||||
return;
|
||||
}
|
||||
if (placepopupnonce != $("#place-popup").data("placepopupnonce")) {
|
||||
console.log("refreshPlaceStats: placepopupnonce changed, stopping redundant refresh");
|
||||
return;
|
||||
}
|
||||
if (app.popup.get("#place-popup").opened) {
|
||||
updatePlaceStats(id);
|
||||
setTimeout(refreshPlaceStats, 2000);
|
||||
|
Loading…
x
Reference in New Issue
Block a user