Skip to content

Commit

Permalink
add clearinterval in case host is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
FreekBes committed Sep 26, 2022
1 parent a57018b commit 644e0d1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions features/clustermap.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ function markTargetHost() {
targetElem.scrollIntoView(false);
iConsole.log("Found clustermap host focus target");
}
else {
iConsole.warn("Target element not found!");
}
}
else {
iConsole.warn("Clustermap not found!");
}
}

Expand All @@ -56,3 +62,6 @@ const highlightInterval = setInterval(function() {
window.location.href = window.location.origin + window.location.pathname + "#";
window.location.href = window.location.origin + window.location.pathname + "#" + targetHost;
}, 250);
setTimeout(function() {
clearInterval(highlightInterval);
}, 5000);

0 comments on commit 644e0d1

Please sign in to comment.