Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add condition to check for swipe-line node in order to destroy on window resize

Edward Plato1d8a6b9b162d
diff --git a/web/js/map/compare/swipe.js b/web/js/map/compare/swipe.js
index 583360412..dde17a94e 100644
--- a/web/js/map/compare/swipe.js
+++ b/web/js/map/compare/swipe.js
@@ -26,8 +26,10 @@ export class Swipe {
events = compareEvents;
this.create();
$(window).resize(() => {
- this.destroy();
- this.create();
+ if (document.querySelector('.ab-swipe-line')) {
+ this.destroy();
+ this.create();
+ }
});
}
create() {