mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Call update_notetype_legacy after toggling sticky
This commit is contained in:
parent
4ab0820bbc
commit
d5b44654b0
1 changed files with 5 additions and 1 deletions
|
@ -32,6 +32,7 @@ from anki.utils import checksum, isLin, isWin, namedtmp
|
||||||
from aqt import AnkiQt, colors, gui_hooks
|
from aqt import AnkiQt, colors, gui_hooks
|
||||||
from aqt.operations import QueryOp
|
from aqt.operations import QueryOp
|
||||||
from aqt.operations.note import update_note
|
from aqt.operations.note import update_note
|
||||||
|
from aqt.operations.notetype import update_notetype_legacy
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
from aqt.sound import av_player
|
from aqt.sound import av_player
|
||||||
from aqt.theme import theme_manager
|
from aqt.theme import theme_manager
|
||||||
|
@ -393,10 +394,13 @@ $editorToolbar.then(({{ toolbar }}) => toolbar.appendGroup({{
|
||||||
(type, num) = cmd.split(":", 1)
|
(type, num) = cmd.split(":", 1)
|
||||||
ord = int(num)
|
ord = int(num)
|
||||||
|
|
||||||
fld = self.note.model()["flds"][ord]
|
model = self.note.model()
|
||||||
|
fld = model["flds"][ord]
|
||||||
new_state = not fld["sticky"]
|
new_state = not fld["sticky"]
|
||||||
fld["sticky"] = new_state
|
fld["sticky"] = new_state
|
||||||
|
|
||||||
|
update_notetype_legacy(parent=self.mw, notetype=model).run_in_background()
|
||||||
|
|
||||||
return new_state
|
return new_state
|
||||||
|
|
||||||
elif cmd in self._links:
|
elif cmd in self._links:
|
||||||
|
|
Loading…
Reference in a new issue