diff options
author | 0neGal <mail@0negal.com> | 2022-02-08 22:35:12 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-02-08 22:35:12 +0100 |
commit | 3ee7928a2412b8041044afd8bd49b922c9941972 (patch) | |
tree | 129fe2d438fa2ee23b82ebc628e0089a43b8e39a /src/app | |
parent | 0de9a3a8d6d7223f3f06ab13e1afe1ff926b5334 (diff) | |
download | Viper-3ee7928a2412b8041044afd8bd49b922c9941972.tar.gz Viper-3ee7928a2412b8041044afd8bd49b922c9941972.zip |
fixed browser being reloaded on every toggle
It now only does it if there's currently no results in the browser, aka
an empty search or it has yet to be loaded once before. Loading it every
time would cause lag.
Diffstat (limited to 'src/app')
-rw-r--r-- | src/app/browser.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/app/browser.js b/src/app/browser.js index f974be0..e1f37e5 100644 --- a/src/app/browser.js +++ b/src/app/browser.js @@ -5,11 +5,14 @@ var packages = []; var Browser = { maxentries: 50, toggle: (state) => { - Browser.loadfront(); if (state) { browser.scrollTo(0, 0); overlay.classList.add("shown") browser.classList.add("shown") + + if (browserEntries.querySelectorAll(".el").length == 0) { + Browser.loadfront(); + } return } else if (! state) { if (state != undefined) { |