mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
Replace note save call for saveTags cmd
This commit is contained in:
parent
8a87e6496c
commit
0a3710e967
2 changed files with 3 additions and 6 deletions
|
@ -468,12 +468,7 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too
|
||||||
self.mw.pm.profile["lastHighlightColor"] = highlightColor
|
self.mw.pm.profile["lastHighlightColor"] = highlightColor
|
||||||
|
|
||||||
elif cmd.startswith("saveTags"):
|
elif cmd.startswith("saveTags"):
|
||||||
(type, tagsJson) = cmd.split(":", 1)
|
|
||||||
self.note.tags = json.loads(tagsJson)
|
|
||||||
|
|
||||||
gui_hooks.editor_did_update_tags(self.note)
|
gui_hooks.editor_did_update_tags(self.note)
|
||||||
if not self.addMode:
|
|
||||||
self._save_current_note()
|
|
||||||
|
|
||||||
elif cmd.startswith("setTagsCollapsed"):
|
elif cmd.startswith("setTagsCollapsed"):
|
||||||
(type, collapsed_string) = cmd.split(":", 1)
|
(type, collapsed_string) = cmd.split(":", 1)
|
||||||
|
|
|
@ -283,7 +283,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
function saveTags({ detail }: CustomEvent): void {
|
function saveTags({ detail }: CustomEvent): void {
|
||||||
tagAmount = detail.tags.filter((tag: string) => tag != "").length;
|
tagAmount = detail.tags.filter((tag: string) => tag != "").length;
|
||||||
lastSavedTags = detail.tags;
|
lastSavedTags = detail.tags;
|
||||||
bridgeCommand(`saveTags:${JSON.stringify(detail.tags)}`);
|
note!.tags = detail.tags;
|
||||||
|
bridgeCommand("saveTags");
|
||||||
|
updateCurrentNote();
|
||||||
}
|
}
|
||||||
|
|
||||||
const fieldSave = new ChangeTimer();
|
const fieldSave = new ChangeTimer();
|
||||||
|
|
Loading…
Reference in a new issue