summaryrefslogtreecommitdiff
path: root/ext/bg/js/settings/scan-inputs-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/settings/scan-inputs-controller.js')
-rw-r--r--ext/bg/js/settings/scan-inputs-controller.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/ext/bg/js/settings/scan-inputs-controller.js b/ext/bg/js/settings/scan-inputs-controller.js
index ec2758cb..04469a8d 100644
--- a/ext/bg/js/settings/scan-inputs-controller.js
+++ b/ext/bg/js/settings/scan-inputs-controller.js
@@ -65,6 +65,10 @@ class ScanInputsController {
this._settingsController.setProfileSetting(path, value);
}
+ instantiateTemplate(name) {
+ return this._settingsController.instantiateTemplate(name);
+ }
+
// Private
_onOptionsChanged({options}) {
@@ -139,7 +143,7 @@ class ScanInputField {
}
prepare(container, include, exclude) {
- const node = this._instantiateTemplate('#scan-input-template');
+ const node = this._parent.instantiateTemplate('scan-input');
const includeInputNode = node.querySelector('.scan-input-field[data-property=include]');
const includeMouseButton = node.querySelector('.mouse-button[data-property=include]');
const excludeInputNode = node.querySelector('.scan-input-field[data-property=exclude]');
@@ -188,12 +192,6 @@ class ScanInputField {
this._parent.removeInput(this._index);
}
- _instantiateTemplate(templateSelector) {
- const template = document.querySelector(templateSelector);
- const content = document.importNode(template.content, true);
- return content.firstChild;
- }
-
_isPointerTypeSupported(pointerType) {
if (this._node === null) { return false; }
const node = this._node.querySelector(`input.scan-input-settings-checkbox[data-property="types.${pointerType}"]`);