show warning when trying to indent plain text

https://forums.ankiweb.net/t/2-1-45-release-candidate/11362/55
This commit is contained in:
Damien Elmes 2021-07-28 12:18:04 +10:00
parent 68dddfe93b
commit 07c2c7ff62

View file

@ -34,6 +34,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
const currentField = document.activeElement as EditingArea;
if (getListItem(currentField.shadowRoot!)) {
document.execCommand("outdent");
} else {
alert("Indent/unindent currently only works with lists.");
}
}
@ -41,6 +43,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
const currentField = document.activeElement as EditingArea;
if (getListItem(currentField.shadowRoot!)) {
document.execCommand("indent");
} else {
alert("Indent/unindent currently only works with lists.");
}
}
</script>