Heydon Pickering преди 8 години
родител
ревизия
718fd3e67a
променени са 3 файла, в които са добавени 18 реда и са изтрити 2 реда
  1. 9 1
      docs/js/dom-scripts.js
  2. 0 0
      docs/service-worker.js
  3. 9 1
      themes/infusion/static/js/dom-scripts.js

+ 9 - 1
docs/js/dom-scripts.js

@@ -96,11 +96,19 @@
 
 /* Switch and persist theme */
 (function () {
+  function CSSSupported (property, value) {
+    var prop = property + ':',
+        el = document.createElement('test'),
+        mStyle = el.style;
+    el.style.cssText = prop + value;
+    return mStyle[property];
+  }
+
   var checkbox = document.getElementById('themer');
   var inverter = document.getElementById('inverter');
 
   function darkTheme(media) {
-    if (!('filter' in document.body.style)) {
+    if (!CSSSupported('filter', 'invert(100%)')) {
       checkbox.parentNode.hidden = true;
       return;
     }

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
docs/service-worker.js


+ 9 - 1
themes/infusion/static/js/dom-scripts.js

@@ -96,11 +96,19 @@
 
 /* Switch and persist theme */
 (function () {
+  function CSSSupported (property, value) {
+    var prop = property + ':',
+        el = document.createElement('test'),
+        mStyle = el.style;
+    el.style.cssText = prop + value;
+    return mStyle[property];
+  }
+
   var checkbox = document.getElementById('themer');
   var inverter = document.getElementById('inverter');
 
   function darkTheme(media) {
-    if (!('filter' in document.body.style)) {
+    if (!CSSSupported('filter', 'invert(100%)')) {
       checkbox.parentNode.hidden = true;
       return;
     }

Някои файлове не бяха показани, защото твърде много файлове са промени