mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Fix bug with initially enabled toolbar in browser
This commit is contained in:
parent
c3b0589bb4
commit
76102db2a9
1 changed files with 6 additions and 1 deletions
|
@ -4,7 +4,7 @@
|
||||||
import { caretToEnd } from "./helpers";
|
import { caretToEnd } from "./helpers";
|
||||||
import { saveField } from "./changeTimer";
|
import { saveField } from "./changeTimer";
|
||||||
import { filterHTML } from "./htmlFilter";
|
import { filterHTML } from "./htmlFilter";
|
||||||
import { updateButtonState } from "./toolbar";
|
import { updateButtonState, disableButtons } from "./toolbar";
|
||||||
|
|
||||||
import { EditorField } from "./editorField";
|
import { EditorField } from "./editorField";
|
||||||
import { LabelContainer } from "./labelContainer";
|
import { LabelContainer } from "./labelContainer";
|
||||||
|
@ -113,6 +113,11 @@ export function setFields(fields: [string, string][]): void {
|
||||||
forEditorField(fields, (field, [name, fieldContent]) =>
|
forEditorField(fields, (field, [name, fieldContent]) =>
|
||||||
field.initialize(name, color, fieldContent)
|
field.initialize(name, color, fieldContent)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!getCurrentField()) {
|
||||||
|
// when initial focus of the window is not on editor (e.g. browser)
|
||||||
|
disableButtons();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setBackgrounds(cols: ("dupe" | "")[]): void {
|
export function setBackgrounds(cols: ("dupe" | "")[]): void {
|
||||||
|
|
Loading…
Reference in a new issue