Skip to content

Commit

Permalink
v13.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
boehlerlukas committed Apr 24, 2024
1 parent a221dd5 commit 0cd6afa
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build/cjs/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/esm/index.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gleap",
"version": "13.6.3",
"version": "13.6.4",
"main": "build/cjs/index.js",
"module": "build/esm/index.mjs",
"exports": {
Expand Down
1 change: 1 addition & 0 deletions published/13.6.4/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion published/latest/index.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/GleapTooltipManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function throttle(fn, time) {
export default class GleapTooltipManager {
tooltips = [];
filteredTooltips = [];
lastUrl = null;
elementToFloatingUIMap = new WeakMap();
elementToTooltipMap = new WeakMap();
nextId = 0;
Expand Down Expand Up @@ -66,16 +67,15 @@ export default class GleapTooltipManager {
return;
}

if (window.navigation) {
window.navigation.addEventListener("navigate", (event) => {
self.updateFilteredTooltips();
});
}

const handleResizeThrottled = throttle(self.updateHotspotPositions.bind(self), 250);
window.addEventListener('resize', handleResizeThrottled);

this.observer = new MutationObserver((mutations) => {
if (self.lastUrl !== window.location.href) {
self.lastUrl = window.location.href;
self.filteredTooltips = self.getFilteredTooltips();
}

mutations.forEach((mutation) => {
// Check for added nodes
mutation.addedNodes.forEach((node) => {
Expand Down

0 comments on commit 0cd6afa

Please sign in to comment.