forked from IITC-CE/ingress-intel-total-conversion
-
Notifications
You must be signed in to change notification settings - Fork 0
portal_detail_display
johnd0e edited this page Sep 11, 2019
·
2 revisions
window.resetScrollOnNewPortal
(introduced by #43)
window.renderPortalDetails.lastVisible
should not be exposed
var lastVisible;
window.resetScrollOnNewPortal = function (isVisible) { // optional
if (selectedPortal !== lastVisible) {
// another portal selected so scroll position become irrelevant to new portal details
if (isVisible || $('#sidebar').is(':visible')) {
$("#sidebar").scrollTop(0); // NB: this works ONLY when #sidebar:visible
lastVisible = selectedPortal;
}
}
};
window.renderPortalDetails = function(guid) {
selectPortal(window.portals[guid] ? guid : null);
window.resetScrollOnNewPortal();