mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
refactor: simplify if-else-construct
This commit is contained in:
parent
447fd6d0c1
commit
783afeff1e
1 changed files with 4 additions and 2 deletions
|
@ -308,10 +308,12 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too
|
||||||
else:
|
else:
|
||||||
image_element = ""
|
image_element = ""
|
||||||
|
|
||||||
if not label and image_element:
|
if not label and icon:
|
||||||
label_element = ""
|
label_element = ""
|
||||||
|
elif label:
|
||||||
|
label_element = label
|
||||||
else:
|
else:
|
||||||
label_element = label or cmd
|
label_element = cmd
|
||||||
|
|
||||||
title_attribute = shortcut(title_attribute)
|
title_attribute = shortcut(title_attribute)
|
||||||
cmd_to_toggle_button = "toggleEditorButton(this);" if toggleable else ""
|
cmd_to_toggle_button = "toggleEditorButton(this);" if toggleable else ""
|
||||||
|
|
Loading…
Reference in a new issue