Skip to content

Commit

Permalink
Remove touchInputEnabled and pointerEventsEnabled (#1585)
Browse files Browse the repository at this point in the history
* Remove touchInputEnabled and pointerEventsEnabled

* Revert small change

* Missed change

* Forgot to save

* Restore _getPointerEventListeners

* Remove unused code

* Add touchEnd and contextMenu

* Refactor MouseEvent into PointerEvent

* typing

* Restore 'mousedown'

* touch tap invalidation when touch move

* remove return for void functions

---------

Co-authored-by: jamesmaa <[email protected]>
  • Loading branch information
khaitruong922 and jamesmaa authored Nov 25, 2024
1 parent 6278812 commit 095160e
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 239 deletions.
10 changes: 0 additions & 10 deletions ext/data/schemas/options-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,6 @@
"required": [
"inputs",
"preventMiddleMouse",
"touchInputEnabled",
"pointerEventsEnabled",
"selectText",
"alphanumeric",
"autoHideResults",
Expand Down Expand Up @@ -676,14 +674,6 @@
}
}
},
"touchInputEnabled": {
"type": "boolean",
"default": true
},
"pointerEventsEnabled": {
"type": "boolean",
"default": false
},
"selectText": {
"type": "boolean",
"default": true
Expand Down
2 changes: 0 additions & 2 deletions ext/js/app/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,6 @@ export class Frontend {
normalizeCssZoom: scanningOptions.normalizeCssZoom,
selectText: scanningOptions.selectText,
delay: scanningOptions.delay,
touchInputEnabled: scanningOptions.touchInputEnabled,
pointerEventsEnabled: scanningOptions.pointerEventsEnabled,
scanLength: scanningOptions.length,
layoutAwareScan: scanningOptions.layoutAwareScan,
matchTypePrefix: scanningOptions.matchTypePrefix,
Expand Down
13 changes: 13 additions & 0 deletions ext/js/data/options-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,7 @@ export class OptionsUtil {
this._updateVersion52,
this._updateVersion53,
this._updateVersion54,
this._updateVersion55,
];
/* eslint-enable @typescript-eslint/unbound-method */
if (typeof targetVersion === 'number' && targetVersion < result.length) {
Expand Down Expand Up @@ -1521,6 +1522,18 @@ export class OptionsUtil {
}
}

/**
* - Remove scanning.touchInputEnabled
* - Remove scanning.pointerEventsEnabled
* @type {import('options-util').UpdateFunction}
*/
async _updateVersion55(options) {
for (const profile of options.profiles) {
delete profile.options.scanning.touchInputEnabled;
delete profile.options.scanning.pointerEventsEnabled;
}
}

/**
* @param {string} url
* @returns {Promise<chrome.tabs.Tab>}
Expand Down
4 changes: 0 additions & 4 deletions ext/js/display/display.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,6 @@ export class Display extends EventDispatcher {
normalizeCssZoom: scanningOptions.normalizeCssZoom,
selectText: scanningOptions.selectText,
delay: scanningOptions.delay,
touchInputEnabled: scanningOptions.touchInputEnabled,
pointerEventsEnabled: scanningOptions.pointerEventsEnabled,
scanLength: scanningOptions.length,
layoutAwareScan: scanningOptions.layoutAwareScan,
preventMiddleMouse: scanningOptions.preventMiddleMouse.onSearchQuery,
Expand Down Expand Up @@ -2054,8 +2052,6 @@ export class Display extends EventDispatcher {
normalizeCssZoom: scanningOptions.normalizeCssZoom,
selectText: false,
delay: scanningOptions.delay,
touchInputEnabled: false,
pointerEventsEnabled: false,
scanLength: scanningOptions.length,
layoutAwareScan: scanningOptions.layoutAwareScan,
preventMiddleMouse: false,
Expand Down
Loading

0 comments on commit 095160e

Please sign in to comment.