mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 21:36:05 +01:00
fixed CSS lazy loading (same file could be loaded multiple times)
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
async function requireCss(url) {
|
||||
const css = Array
|
||||
const cssLinks = Array
|
||||
.from(document.querySelectorAll('link'))
|
||||
.map(scr => scr.href);
|
||||
.map(el => el.href);
|
||||
|
||||
if (!css.includes(url)) {
|
||||
if (!cssLinks.some(l => l.endsWith(url))) {
|
||||
$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', url));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user