about summary refs log tree commit diff
diff options
context:
space:
mode:
-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);
+      }
     }
   }