refactor: simplify if-else-construct

This commit is contained in:
David Culley 2024-07-10 20:07:01 +02:00
parent 447fd6d0c1
commit 783afeff1e
No known key found for this signature in database
GPG key ID: E6D8947E83ACCD4F

View file

@ -308,10 +308,12 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too
else:
image_element = ""
if not label and image_element:
if not label and icon:
label_element = ""
elif label:
label_element = label
else:
label_element = label or cmd
label_element = cmd
title_attribute = shortcut(title_attribute)
cmd_to_toggle_button = "toggleEditorButton(this);" if toggleable else ""