mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
Fix formatting/typing errors
This commit is contained in:
parent
3084d59fb4
commit
9dcbf70aeb
2 changed files with 23 additions and 18 deletions
|
|
@ -443,7 +443,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
closeMathjaxEditor?.();
|
||||
$commitTagEdits();
|
||||
await saveFieldNow();
|
||||
if(!isLegacy) {
|
||||
if (!isLegacy) {
|
||||
bridgeCommand("saved");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,43 +46,48 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
$: setStyling("fontSize", fontSize + "px");
|
||||
$: setStyling("direction", direction);
|
||||
|
||||
|
||||
async function attachToShadow(element: Element) {
|
||||
let styles: StyleLinkType[];
|
||||
function attachToShadow(element: Element) {
|
||||
let stylesPromise: Promise<StyleLinkType[]>;
|
||||
if (isLegacy) {
|
||||
styles = [
|
||||
stylesPromise = Promise.resolve([
|
||||
{
|
||||
id: "rootStyle",
|
||||
type: "link",
|
||||
href: "./_anki/css/editable.css",
|
||||
},
|
||||
];
|
||||
]);
|
||||
} else {
|
||||
styles = [
|
||||
stylesPromise = Promise.all([
|
||||
import("$lib/editable/editable-base.scss?url"),
|
||||
import("$lib/editable/content-editable.scss?url"),
|
||||
import("$lib/editable/mathjax.scss?url"),
|
||||
]).then(([editableBase, contentEditable, mathjax]) => [
|
||||
{
|
||||
id: "editableBaseStyle",
|
||||
type: "link",
|
||||
href: (await import("$lib/editable/editable-base.scss?url")).default,
|
||||
href: editableBase.default,
|
||||
},
|
||||
{
|
||||
id: "contentEditableStyle",
|
||||
type: "link",
|
||||
href: (await import("$lib/editable/content-editable.scss?url")).default,
|
||||
href: contentEditable.default,
|
||||
},
|
||||
{
|
||||
id: "mathjaxStyle",
|
||||
type: "link",
|
||||
href: (await import("$lib/editable/mathjax.scss?url")).default,
|
||||
href: mathjax.default,
|
||||
},
|
||||
];
|
||||
]);
|
||||
}
|
||||
const customStyles = mount(CustomStyles, {
|
||||
target: element.shadowRoot!,
|
||||
props: { styles },
|
||||
});
|
||||
customStyles.addStyleTag("userBase").then((styleTag) => {
|
||||
userBaseResolve(styleTag);
|
||||
callback(customStyles);
|
||||
stylesPromise.then((styles) => {
|
||||
const customStyles = mount(CustomStyles, {
|
||||
target: element.shadowRoot!,
|
||||
props: { styles },
|
||||
});
|
||||
customStyles.addStyleTag("userBase").then((styleTag) => {
|
||||
userBaseResolve(styleTag);
|
||||
callback(customStyles);
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue