diff options
| author | Jieiku | 2022-08-23 13:41:41 -0700 |
|---|---|---|
| committer | Jieiku | 2022-08-23 13:41:41 -0700 |
| commit | c7b914505b6505b013610cc71e3b50d68c4a5473 (patch) | |
| tree | d2abebfa75cedd1b7351b51f9d5c909834e8d05d /static/tinysearch.js | |
| parent | 6e6c0cbbb5d6136788d35ee5a354d36079c3475a (diff) | |
| download | abridge-c7b914505b6505b013610cc71e3b50d68c4a5473.tar.gz abridge-c7b914505b6505b013610cc71e3b50d68c4a5473.tar.bz2 abridge-c7b914505b6505b013610cc71e3b50d68c4a5473.zip | |
Optimizations, Update Readme YellowLabTools
Diffstat (limited to 'static/tinysearch.js')
| -rw-r--r-- | static/tinysearch.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/static/tinysearch.js b/static/tinysearch.js index 80e8984..ab099ca 100644 --- a/static/tinysearch.js +++ b/static/tinysearch.js @@ -1,7 +1,3 @@ -var baseUrl = document.querySelector("meta[name='base']").getAttribute("content"); -if (baseUrl.slice(-1) == "/") { - baseUrl = baseUrl.slice(0, -1); -} // in page results when press enter or click search icon from search box function closeSearchNow() { const main = document.querySelector("main"); @@ -36,6 +32,10 @@ window.onload = function() { }; async function lazyLoad() { + var baseUrl = document.querySelector("meta[name='base']").getAttribute("content"); + if (baseUrl.slice(-1) == "/") { + baseUrl = baseUrl.slice(0, -1); + } await init(baseUrl + "/tinysearch_engine_bg.wasm") } @@ -223,6 +223,10 @@ async function load(e, t) { } : n } async function init(e) { + var baseUrl = document.querySelector("meta[name='base']").getAttribute("content"); + if (baseUrl.slice(-1) == "/") { + baseUrl = baseUrl.slice(0, -1); + } void 0 === e && (e = new URL(baseUrl + "/tinysearch_engine_bg.wasm", import.meta.url)); const t = { wbg: {} |
