mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -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 { wrap } from "./wrap";
|
||||||
import { appendInParentheses } from "./helpers";
|
import { appendInParentheses } from "./helpers";
|
||||||
import { forEditorField, getEditorField } from ".";
|
import { getCurrentField } from ".";
|
||||||
import { paperclipIcon, micIcon, functionIcon, xmlIcon } from "./icons";
|
import { paperclipIcon, micIcon, functionIcon, xmlIcon } from "./icons";
|
||||||
|
|
||||||
export let api = {};
|
export let api = {};
|
||||||
|
@ -32,13 +32,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkHtmlEdit() {
|
function checkHtmlEdit() {
|
||||||
return getEditorField(0)!.editingArea.codable.active;
|
const currentField = getCurrentField();
|
||||||
|
return currentField ? currentField.codable.active : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function onHtmlEdit() {
|
function onHtmlEdit() {
|
||||||
forEditorField([], (field) => {
|
const currentField = getCurrentField();
|
||||||
field.editingArea.toggleHtmlEdit();
|
if (currentField) {
|
||||||
});
|
currentField.toggleHtmlEdit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -187,7 +189,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
updateState(event);
|
updateState(event);
|
||||||
}}
|
}}
|
||||||
on:mount={createShortcut}
|
on:mount={createShortcut}
|
||||||
disables={false}
|
|
||||||
>
|
>
|
||||||
{@html xmlIcon}
|
{@html xmlIcon}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
|
Loading…
Reference in a new issue