about summary refs log tree commit diff
path: root/app/javascript/mastodon/features
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-04-05 14:31:07 +0200
committerClaire <claire.github-309c@sitedethib.com>2021-04-05 14:31:07 +0200
commitc901ae77d43bc76afc5c927c82b9b75609fa3a58 (patch)
tree41ccfe01da595433ef64e229a767ac62b7adfd92 /app/javascript/mastodon/features
parent39b9a0619ab4ba68ed429152153cf0dbbfcd5a5a (diff)
parent117f6638d0c402162c60915c7b8946489f1e89df (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/javascript/mastodon/features')
-rw-r--r--app/javascript/mastodon/features/ui/components/columns_area.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/ui/components/columns_area.js b/app/javascript/mastodon/features/ui/components/columns_area.js
index 85a92fc3a..270be2851 100644
--- a/app/javascript/mastodon/features/ui/components/columns_area.js
+++ b/app/javascript/mastodon/features/ui/components/columns_area.js
@@ -90,7 +90,11 @@ class ColumnsArea extends ImmutablePureComponent {
     }
 
     if (this.mediaQuery) {
-      this.mediaQuery.addEventListener('change', this.handleLayoutChange);
+      if (this.mediaQuery.addEventListener) {
+        this.mediaQuery.addEventListener('change', this.handleLayoutChange);
+      } else {
+        this.mediaQuery.addListener(this.handleLayoutChange);
+      }
       this.setState({ renderComposePanel: !this.mediaQuery.matches });
     }
 
@@ -125,7 +129,11 @@ class ColumnsArea extends ImmutablePureComponent {
     }
 
     if (this.mediaQuery) {
-      this.mediaQuery.removeEventListener('change', this.handleLayoutChange);
+      if (this.mediaQuery.removeEventListener) {
+        this.mediaQuery.removeEventListener('change', this.handleLayoutChange);
+      } else {
+        this.mediaQuery.removeListener(this.handleLayouteChange);
+      }
     }
   }