From ce7137c54d817dc9a3076015014d37d90cbfabcd Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 21 Feb 2022 02:36:03 +0300 Subject: [PATCH] preload nearby favicons --- manage/events.js | 2 +- manage/render.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/manage/events.js b/manage/events.js index f96359ff..0686688a 100644 --- a/manage/events.js +++ b/manage/events.js @@ -79,7 +79,7 @@ const Events = { expandTargets(event, entry) { if (!entry._allTargetsRendered) { createTargetsElement({entry, expanded: true}); - setTimeout(getFaviconSrc, 0, entry); + getFaviconSrc(entry); } this.closest('.applies-to').classList.toggle('expanded'); }, diff --git a/manage/render.js b/manage/render.js index 0c67205f..90e495db 100644 --- a/manage/render.js +++ b/manage/render.js @@ -31,7 +31,7 @@ const AGES = [ delete el.dataset.src; } } - }); + }, {rootMargin: '200px'}); Object.defineProperty(proto, 'src', Object.assign({}, pSrc, { set(val) { if (this.loading === 'lazy') { @@ -87,7 +87,6 @@ function createStyleElement({style, name: nameLC}) { infoVer: $('[data-type=version]', entry), appliesTo: $('.applies-to', entry), targets: $('.targets', entry), - expander: $('.expander', entry), decorations: { urlPrefixesAfter: '*', regexpsBefore: '/',