diff options
Diffstat (limited to 'ext/bg/js/settings/scan-inputs-controller.js')
-rw-r--r-- | ext/bg/js/settings/scan-inputs-controller.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/bg/js/settings/scan-inputs-controller.js b/ext/bg/js/settings/scan-inputs-controller.js index 84621094..3151e4fd 100644 --- a/ext/bg/js/settings/scan-inputs-controller.js +++ b/ext/bg/js/settings/scan-inputs-controller.js @@ -138,8 +138,9 @@ class ScanInputField { this._node = node; container.appendChild(node); - this._includeInputField = new KeyboardMouseInputField(includeInputNode, includeMouseButton, this._os); - this._excludeInputField = new KeyboardMouseInputField(excludeInputNode, excludeMouseButton, this._os); + const isPointerTypeSupported = this._isPointerTypeSupported.bind(this); + this._includeInputField = new KeyboardMouseInputField(includeInputNode, includeMouseButton, this._os, isPointerTypeSupported); + this._excludeInputField = new KeyboardMouseInputField(excludeInputNode, excludeMouseButton, this._os, isPointerTypeSupported); this._includeInputField.prepare(include, 'modifierInputs'); this._excludeInputField.prepare(exclude, 'modifierInputs'); @@ -184,4 +185,10 @@ class ScanInputField { 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-type-checkbox[data-type=${pointerType}]`); + return node !== null && node.checked; + } } |