mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
Fix toggleable editor button styles (#2531)
This commit is contained in:
parent
e94ab5a44d
commit
51dc5860bd
3 changed files with 11 additions and 1 deletions
|
@ -236,7 +236,9 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too
|
|||
|
||||
def on_hotkey() -> None:
|
||||
on_activated()
|
||||
self.web.eval(f'toggleEditorButton("#{id}");')
|
||||
self.web.eval(
|
||||
f'toggleEditorButton(document.getElementById("{id}"));'
|
||||
)
|
||||
|
||||
else:
|
||||
on_hotkey = on_activated
|
||||
|
|
|
@ -33,3 +33,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
button {
|
||||
@include button.base($active-class: active);
|
||||
}
|
||||
|
|
|
@ -21,3 +21,7 @@ export function setFormat(cmd: string, arg?: string, _nosave = false): void {
|
|||
execCommand(cmd, false, arg);
|
||||
updateAllState(new Event(cmd));
|
||||
}
|
||||
|
||||
export function toggleEditorButton(button: HTMLButtonElement): void {
|
||||
button.classList.toggle("active");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue