diff options
author | Kuuuube <61125188+Kuuuube@users.noreply.github.com> | 2024-04-14 12:48:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-14 16:48:25 +0000 |
commit | 7df7e1b2bf475edd771a73a950004ab8d5f85ccb (patch) | |
tree | a4aa178c144780968477a105d29eeeffe215c7ed /ext/js/data/options-util.js | |
parent | f2b3eb4eddb282d4eb88488b3dbc47c948891a6d (diff) |
Add scanOnTouchTap and improve touch scanning defaults (#791)24.4.14.0
* Add scanOnTouchTap
* Update version to 30
* Cleanup if statement
Diffstat (limited to 'ext/js/data/options-util.js')
-rw-r--r-- | ext/js/data/options-util.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index af81f29e..4e468aea 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -535,7 +535,8 @@ export class OptionsUtil { this._updateVersion26, this._updateVersion27, this._updateVersion28, - this._updateVersion29 + this._updateVersion29, + this._updateVersion30 ]; /* eslint-enable @typescript-eslint/unbound-method */ if (typeof targetVersion === 'number' && targetVersion < result.length) { @@ -605,7 +606,7 @@ export class OptionsUtil { showAdvanced: false, searchTerms: true, searchKanji: true, - scanOnTouchMove: true, + scanOnTouchMove: false, scanOnPenHover: true, scanOnPenPress: true, scanOnPenRelease: false, @@ -1217,6 +1218,20 @@ export class OptionsUtil { await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v29.handlebars'); } + /** + * - Added scanning.inputs[].options.scanOnTouchTap. + * - Set touch settings to be more sensible. + * @type {import('options-util').UpdateFunction} + */ + async _updateVersion30(options) { + for (const profile of options.profiles) { + for (const input of profile.options.scanning.inputs) { + input.options.scanOnTouchTap = true; + input.options.scanOnTouchPress = false; + input.options.scanOnTouchRelease = false; + } + } + } /** * @param {string} url |