Skip to content

Commit b80c7e4

Browse files
authored
fix(meteorites-map): add small tolerance to prevent reloading on small fluctuations.
1 parent 63c4af4 commit b80c7e4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

online/meteorites-map.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,9 @@
399399

400400
area_index: 0,
401401

402-
starting_width: $(document).width()
402+
starting_width: $(document).width(),
403+
404+
tol_resize: 15
403405

404406
};
405407

@@ -967,7 +969,7 @@ <h2>Top ${extendedData.ranking} des classes de météorites:</h2>
967969

968970
let newWidth = $(document).width();
969971

970-
if (extendedData.starting_width !== newWidth) document.location.reload(true);
972+
if (Math.abs(extendedData.starting_width - newWidth) > extendedData.tol_resize) document.location.reload(true);
971973

972974
});
973975

@@ -1015,3 +1017,4 @@ <h2>Top ${extendedData.ranking} des classes de météorites:</h2>
10151017

10161018
</html>
10171019

1020+

0 commit comments

Comments
 (0)