preload nearby favicons

This commit is contained in:
tophf 2022-02-21 02:36:03 +03:00
parent 62974751ff
commit ce7137c54d
2 changed files with 2 additions and 3 deletions

View File

@ -79,7 +79,7 @@ const Events = {
expandTargets(event, entry) { expandTargets(event, entry) {
if (!entry._allTargetsRendered) { if (!entry._allTargetsRendered) {
createTargetsElement({entry, expanded: true}); createTargetsElement({entry, expanded: true});
setTimeout(getFaviconSrc, 0, entry); getFaviconSrc(entry);
} }
this.closest('.applies-to').classList.toggle('expanded'); this.closest('.applies-to').classList.toggle('expanded');
}, },

View File

@ -31,7 +31,7 @@ const AGES = [
delete el.dataset.src; delete el.dataset.src;
} }
} }
}); }, {rootMargin: '200px'});
Object.defineProperty(proto, 'src', Object.assign({}, pSrc, { Object.defineProperty(proto, 'src', Object.assign({}, pSrc, {
set(val) { set(val) {
if (this.loading === 'lazy') { if (this.loading === 'lazy') {
@ -87,7 +87,6 @@ function createStyleElement({style, name: nameLC}) {
infoVer: $('[data-type=version]', entry), infoVer: $('[data-type=version]', entry),
appliesTo: $('.applies-to', entry), appliesTo: $('.applies-to', entry),
targets: $('.targets', entry), targets: $('.targets', entry),
expander: $('.expander', entry),
decorations: { decorations: {
urlPrefixesAfter: '*', urlPrefixesAfter: '*',
regexpsBefore: '/', regexpsBefore: '/',