mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Make attachToShadow an async function
This commit is contained in:
parent
3aba3772aa
commit
b62705eadf
1 changed files with 4 additions and 5 deletions
|
@ -47,16 +47,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
} as StyleLinkType,
|
} as StyleLinkType,
|
||||||
];
|
];
|
||||||
|
|
||||||
function attachToShadow(element: Element) {
|
async function attachToShadow(element: Element): Promise<void> {
|
||||||
const customStyles = new CustomStyles({
|
const customStyles = new CustomStyles({
|
||||||
target: element.shadowRoot as any,
|
target: element.shadowRoot as any,
|
||||||
props: { styles },
|
props: { styles },
|
||||||
});
|
});
|
||||||
|
|
||||||
customStyles.addStyleTag("userBase").then((styleTag) => {
|
const styleTag = await customStyles.addStyleTag("userBase");
|
||||||
userBaseResolve(styleTag);
|
userBaseResolve(styleTag);
|
||||||
callback(customStyles);
|
callback(customStyles);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue