mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
commit
0e4bcbd69b
1 changed files with 15 additions and 7 deletions
|
@ -111,8 +111,10 @@ export function setFields(fields: [string, string][]): void {
|
||||||
.getPropertyValue("--text-fg");
|
.getPropertyValue("--text-fg");
|
||||||
|
|
||||||
adjustFieldAmount(fields.length);
|
adjustFieldAmount(fields.length);
|
||||||
forEditorField(fields, (field, [name, fieldContent]) =>
|
forEditorField(
|
||||||
field.initialize(name, color, fieldContent)
|
fields,
|
||||||
|
(field: EditorField, [name, fieldContent]: [string, string]): void =>
|
||||||
|
field.initialize(name, color, fieldContent)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!getCurrentField()) {
|
if (!getCurrentField()) {
|
||||||
|
@ -122,7 +124,7 @@ export function setFields(fields: [string, string][]): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setBackgrounds(cols: ("dupe" | "")[]): void {
|
export function setBackgrounds(cols: ("dupe" | "")[]): void {
|
||||||
forEditorField(cols, (field, value) =>
|
forEditorField(cols, (field: EditorField, value: "dupe" | "") =>
|
||||||
field.editingArea.classList.toggle("dupe", value === "dupe")
|
field.editingArea.classList.toggle("dupe", value === "dupe")
|
||||||
);
|
);
|
||||||
document
|
document
|
||||||
|
@ -131,13 +133,19 @@ export function setBackgrounds(cols: ("dupe" | "")[]): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setFonts(fonts: [string, number, boolean][]): void {
|
export function setFonts(fonts: [string, number, boolean][]): void {
|
||||||
forEditorField(fonts, (field, [fontFamily, fontSize, isRtl]) => {
|
forEditorField(
|
||||||
field.setBaseStyling(fontFamily, `${fontSize}px`, isRtl ? "rtl" : "ltr");
|
fonts,
|
||||||
});
|
(
|
||||||
|
field: EditorField,
|
||||||
|
[fontFamily, fontSize, isRtl]: [string, number, boolean]
|
||||||
|
) => {
|
||||||
|
field.setBaseStyling(fontFamily, `${fontSize}px`, isRtl ? "rtl" : "ltr");
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setSticky(stickies: boolean[]): void {
|
export function setSticky(stickies: boolean[]): void {
|
||||||
forEditorField(stickies, (field, isSticky) => {
|
forEditorField(stickies, (field: EditorField, isSticky: boolean) => {
|
||||||
field.labelContainer.activateSticky(isSticky);
|
field.labelContainer.activateSticky(isSticky);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue