summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/settings')
-rw-r--r--ext/bg/js/settings/scan-inputs-controller.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/ext/bg/js/settings/scan-inputs-controller.js b/ext/bg/js/settings/scan-inputs-controller.js
index 0606d142..5da0d5e1 100644
--- a/ext/bg/js/settings/scan-inputs-controller.js
+++ b/ext/bg/js/settings/scan-inputs-controller.js
@@ -135,6 +135,7 @@ class ScanInputField {
set index(value) {
this._index = value;
+ this._updateDataSettingTargets();
}
prepare(container, include, exclude) {
@@ -158,10 +159,7 @@ class ScanInputField {
this._eventListeners.on(this._excludeInputField, 'change', this._onExcludeValueChange.bind(this));
this._eventListeners.addEventListener(removeButton, 'click', this._onRemoveClick.bind(this));
- for (const typeCheckbox of node.querySelectorAll('.scan-input-settings-checkbox')) {
- const {property} = typeCheckbox.dataset;
- typeCheckbox.dataset.setting = `scanning.inputs[${this._index}].${property}`;
- }
+ this._updateDataSettingTargets();
}
cleanup() {
@@ -201,4 +199,12 @@ class ScanInputField {
const node = this._node.querySelector(`input.scan-input-settings-checkbox[data-property="types.${pointerType}"]`);
return node !== null && node.checked;
}
+
+ _updateDataSettingTargets() {
+ const index = this._index;
+ for (const typeCheckbox of this._node.querySelectorAll('.scan-input-settings-checkbox')) {
+ const {property} = typeCheckbox.dataset;
+ typeCheckbox.dataset.setting = `scanning.inputs[${index}].${property}`;
+ }
+ }
}