Move setShrinkImages()

This commit is contained in:
Abdo 2025-05-28 11:38:05 +03:00
parent 0198a58a1c
commit 4ab3970cd6
3 changed files with 2 additions and 10 deletions

View file

@ -1260,12 +1260,6 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too
def insertMathjaxChemistry(self) -> None:
self.web.eval("wrap('\\\\(\\\\ce{', '}\\\\)');")
def toggleShrinkImages(self) -> None:
self.mw.col.set_config(
"shrinkEditorImages",
not self.mw.col.get_config("shrinkEditorImages", True),
)
def toggleCloseHTMLTags(self) -> None:
self.mw.col.set_config(
"closeHTMLTags",
@ -1301,7 +1295,6 @@ require("anki/ui").loaded.then(() => require("anki/NoteEditor").instances[0].too
mathjaxInline=Editor.insertMathjaxInline,
mathjaxBlock=Editor.insertMathjaxBlock,
mathjaxChemistry=Editor.insertMathjaxChemistry,
toggleShrinkImages=Editor.toggleShrinkImages,
toggleCloseHTMLTags=Editor.toggleCloseHTMLTags,
addImageForOcclusion=Editor.select_image_and_occlude,
addImageForOcclusionFromClipboard=Editor.select_image_from_clipboard_and_occlude,

View file

@ -644,8 +644,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
setTags(tags);
setTagsCollapsed(await getMeta(tagsCollapsedMetaKey));
setMathjaxEnabled((await getColConfig("renderMathjax")) ?? true);
// TODO: shrinkEditorImages col config
setShrinkImages(true);
setShrinkImages((await getColConfig("shrinkEditorImages")) ?? true);
// TODO: closeHTMLTags col config
setCloseHTMLTags(true);
if (mode === "add") {

View file

@ -23,7 +23,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
function toggleShrinkImages(_evt: MouseEvent): void {
$shrinkImagesByDefault = !$shrinkImagesByDefault;
bridgeCommand("toggleShrinkImages");
setColConfig("shrinkEditorImages", $shrinkImagesByDefault);
showFloating = false;
}