From d1fcf21461e901a5b67586f64102fe15b5d17ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Fri, 3 Feb 2023 23:35:16 +0100 Subject: [PATCH] global: remove jQuery #452 --- static/js/search.js | 1 - static/js/theme.js | 2 +- static/js/variant.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/static/js/search.js b/static/js/search.js index 895f3a7d2a..66ea2f10b0 100644 --- a/static/js/search.js +++ b/static/js/search.js @@ -206,7 +206,6 @@ function searchDetail() { initLunrJson(); initLunrJs(); - function startSearch(){ var url = new URL( window.location ); window.history.replaceState(url.toString(), '', url); diff --git a/static/js/theme.js b/static/js/theme.js index 68ab29622e..f48552fce7 100644 --- a/static/js/theme.js +++ b/static/js/theme.js @@ -1029,7 +1029,7 @@ function initSearch() { window.relearn.runInitialSearch && window.relearn.runInitialSearch(); } -jQuery(function() { +ready( function(){ initArrowNav(); initMermaid(); initSwagger(); diff --git a/static/js/variant.js b/static/js/variant.js index 167e9e1120..d9a08d1db5 100644 --- a/static/js/variant.js +++ b/static/js/variant.js @@ -25,7 +25,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o = function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } -function ready(fn) { if (document.readyState !== 'loading') { fn(); } else { document.addEventListener('DOMContentLoaded',fn); } } +function ready(fn) { if (document.readyState == 'complete') { fn(); } else { document.addEventListener('DOMContentLoaded',fn); } } var variants = { variant: '',