mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Only toggle the current field, not all
This commit is contained in:
parent
7266f485d0
commit
a87f81f00b
1 changed files with 7 additions and 6 deletions
|
@ -18,7 +18,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
|
||||
import { wrap } from "./wrap";
|
||||
import { appendInParentheses } from "./helpers";
|
||||
import { forEditorField, getEditorField } from ".";
|
||||
import { getCurrentField } from ".";
|
||||
import { paperclipIcon, micIcon, functionIcon, xmlIcon } from "./icons";
|
||||
|
||||
export let api = {};
|
||||
|
@ -32,13 +32,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
}
|
||||
|
||||
function checkHtmlEdit() {
|
||||
return getEditorField(0)!.editingArea.codable.active;
|
||||
const currentField = getCurrentField();
|
||||
return currentField ? currentField.codable.active : false;
|
||||
}
|
||||
|
||||
function onHtmlEdit() {
|
||||
forEditorField([], (field) => {
|
||||
field.editingArea.toggleHtmlEdit();
|
||||
});
|
||||
const currentField = getCurrentField();
|
||||
if (currentField) {
|
||||
currentField.toggleHtmlEdit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -187,7 +189,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
updateState(event);
|
||||
}}
|
||||
on:mount={createShortcut}
|
||||
disables={false}
|
||||
>
|
||||
{@html xmlIcon}
|
||||
</IconButton>
|
||||
|
|
Loading…
Reference in a new issue