mirror of
https://github.com/ankitects/anki.git
synced 2025-12-30 23:32:57 -05:00
Backport merge pull request #1063 from hgiesel/edithtmlfix
Fix bug with initially enabled toolbar in browser
This commit is contained in:
parent
7e14f72121
commit
6cdaa48cdc
1 changed files with 6 additions and 1 deletions
|
|
@ -5,7 +5,7 @@ import { nodeIsInline, caretToEnd } from "./helpers";
|
|||
import { bridgeCommand } from "./lib";
|
||||
import { saveField } from "./changeTimer";
|
||||
import { filterHTML } from "./htmlFilter";
|
||||
import { updateButtonState } from "./toolbar";
|
||||
import { updateButtonState, disableButtons } from "./toolbar";
|
||||
import { onInput, onKey, onKeyUp } from "./inputHandlers";
|
||||
import { onFocus, onBlur } from "./focusHandlers";
|
||||
|
||||
|
|
@ -302,6 +302,11 @@ export function setFields(fields: [string, string][]): void {
|
|||
forEditorField(fields, (field, [name, 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" | "")[]) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue