Просмотр исходного кода

#4883 Ability to override bx_check_mq js function

Alex Trofimov 1 год назад
Родитель
Сommit
647a5ea8a1
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      inc/js/functions.js

+ 4 - 0
inc/js/functions.js

@@ -1487,6 +1487,10 @@ function bx_set_color_scheme_html()
  */
 function bx_check_mq()
 {
+    if (typeof glOnCheckMq === 'function') {
+        return glOnCheckMq();
+    }
+
     return window.getComputedStyle(document.querySelector('body'), '::before').getPropertyValue('content').replace(/'/g, "").replace(/"/g, "");
 }