Skip to content

Commit 5cf12c5

Browse files
committed
fix: use $(window) instead of $(document) for responsive handling.
1 parent 743efa3 commit 5cf12c5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

js/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var globalData = {
22

33
modalbox_size: `${Math.round($(window).width() - 8)}px`,
44

5-
starting_width: $(document).width(),
5+
starting_width: $(window).width(),
66

77
tol_resize: 10
88

@@ -12,7 +12,7 @@ document.oncontextmenu = () => { return false; }
1212

1313
$(window).on('resize', () => {
1414

15-
let newWidth = $(document).width();
15+
let newWidth = $(window).width();
1616

1717
if (Math.abs(globalData.starting_width - newWidth) > globalData.tol_resize) document.location.reload();
1818

online/meteorites-map.html

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

400400
area_index: 0,
401401

402-
starting_width: $(document).width(),
402+
starting_width: $(window).width(),
403403

404404
tol_resize: 10
405405

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

971971
$(window).on('resize', () => {
972972

973-
let newWidth = $(document).width();
973+
let newWidth = $(window).width();
974974

975975
if (Math.abs(extendedData.starting_width - newWidth) > extendedData.tol_resize) document.location.reload();
976976

0 commit comments

Comments
 (0)