diff --git a/django_ace/static/django_ace/widget.js b/django_ace/static/django_ace/widget.js
index 7da6f32436..de517577fa 100644
--- a/django_ace/static/django_ace/widget.js
+++ b/django_ace/static/django_ace/widget.js
@@ -111,9 +111,15 @@
}
setEditorTheme(window.matchMedia('(prefers-color-scheme: dark)').matches);
- window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function(ev) {
- setEditorTheme(ev.matches);
- })
+ try {
+ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function(ev) {
+ setEditorTheme(ev.matches);
+ })
+ } catch (err) {
+ window.matchMedia('(prefers-color-scheme: dark)').addListener(function(ev) {
+ setEditorTheme(ev.matches);
+ })
+ }
}
}
if (wordwrap == "true") {
diff --git a/templates/base.html b/templates/base.html
index c866ab3568..113868bd30 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -49,7 +49,7 @@
{% if PREFERRED_STYLE_CSS is not none %}
{% else %}
-
+
{% endif %}
{% else %}