mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Refactor out theclass assignment
This commit is contained in:
parent
4c255b0289
commit
e8c80174eb
1 changed files with 3 additions and 4 deletions
|
@ -284,12 +284,11 @@ class Editor:
|
||||||
else:
|
else:
|
||||||
toggleScript = ""
|
toggleScript = ""
|
||||||
tip = shortcut(tip)
|
tip = shortcut(tip)
|
||||||
theclass = class_
|
|
||||||
if not disables:
|
if not disables:
|
||||||
theclass += " perm"
|
class_ += " perm"
|
||||||
return """ <button tabindex=-1
|
return """ <button tabindex=-1
|
||||||
{id}
|
{id}
|
||||||
class="{theclass}"
|
class="{class_}"
|
||||||
type="button"
|
type="button"
|
||||||
title="{tip}"
|
title="{tip}"
|
||||||
onclick="pycmd('{cmd}');{togglesc}return false;"
|
onclick="pycmd('{cmd}');{togglesc}return false;"
|
||||||
|
@ -303,7 +302,7 @@ class Editor:
|
||||||
labelelm=labelelm,
|
labelelm=labelelm,
|
||||||
id=idstr,
|
id=idstr,
|
||||||
togglesc=toggleScript,
|
togglesc=toggleScript,
|
||||||
theclass=theclass,
|
class_=class_,
|
||||||
)
|
)
|
||||||
|
|
||||||
def setupShortcuts(self) -> None:
|
def setupShortcuts(self) -> None:
|
||||||
|
|
Loading…
Reference in a new issue