summaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/settings/anki-controller.js2
-rw-r--r--ext/bg/js/settings/anki-templates-controller.js2
-rw-r--r--ext/bg/js/settings/profile-conditions-ui.js4
3 files changed, 4 insertions, 4 deletions
diff --git a/ext/bg/js/settings/anki-controller.js b/ext/bg/js/settings/anki-controller.js
index 541916b7..77b4ce96 100644
--- a/ext/bg/js/settings/anki-controller.js
+++ b/ext/bg/js/settings/anki-controller.js
@@ -535,7 +535,7 @@ class AnkiCardController {
const fieldNamesSet = new Set(fieldNames);
let index = 0;
for (const [fieldName, {fieldNameContainerNode}] of fieldMap.entries()) {
- fieldNameContainerNode.dataset.isValid = `${fieldNamesSet.has(fieldName)}`;
+ fieldNameContainerNode.dataset.invalid = `${!fieldNamesSet.has(fieldName)}`;
fieldNameContainerNode.dataset.orderMatches = `${index < fieldNames.length && fieldName === fieldNames[index]}`;
++index;
}
diff --git a/ext/bg/js/settings/anki-templates-controller.js b/ext/bg/js/settings/anki-templates-controller.js
index edf6f2c8..e68656c5 100644
--- a/ext/bg/js/settings/anki-templates-controller.js
+++ b/ext/bg/js/settings/anki-templates-controller.js
@@ -210,7 +210,7 @@ class AnkiTemplatesController {
infoNode.textContent = hasException ? exceptions.map((e) => `${e}`).join('\n') : (showSuccessResult ? result : '');
infoNode.classList.toggle('text-danger', hasException);
if (invalidateInput) {
- this._fieldTemplatesTextarea.classList.toggle('is-invalid', hasException);
+ this._fieldTemplatesTextarea.dataset.invalid = `${hasException}`;
}
}
diff --git a/ext/bg/js/settings/profile-conditions-ui.js b/ext/bg/js/settings/profile-conditions-ui.js
index 78155467..256130ca 100644
--- a/ext/bg/js/settings/profile-conditions-ui.js
+++ b/ext/bg/js/settings/profile-conditions-ui.js
@@ -614,7 +614,7 @@ class ProfileConditionUI {
}
this._value = value;
- node.classList.remove('is-invalid');
+ delete node.dataset.invalid;
node.type = inputType;
if (inputValue !== null) {
node.value = inputValue;
@@ -634,7 +634,7 @@ class ProfileConditionUI {
_validateValue(value, validate) {
const okay = (validate === null || validate(value));
- this._valueInput.classList.toggle('is-invalid', !okay);
+ this._valueInput.dataset.invalid = `${!okay}`;
return okay;
}