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: '',