diff options
| -rw-r--r-- | src/App.vue | 2 | ||||
| -rw-r--r-- | src/components/SettingsModal.vue | 4 | ||||
| -rw-r--r-- | src/components/Tile.vue | 4 | ||||
| -rw-r--r-- | src/lib.ts | 4 |
4 files changed, 6 insertions, 8 deletions
diff --git a/src/App.vue b/src/App.vue index ab16c00..0cf2df0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -788,7 +788,7 @@ export default defineComponent({ } for (let prop of Object.getOwnPropertyNames(uiOpts) as (keyof UiOptions)[]){ let item = localStorage.getItem('UI ' + prop); - //Not: Using JSON.stringify here to roughly deep-compare values + //Note: Using JSON.stringify here to roughly deep-compare values if (item == null && JSON.stringify(this.uiOpts[prop]) != JSON.stringify(uiOpts[prop])){ this.uiOpts[prop] = uiOpts[prop]; if (prop == 'useReducedTree'){ diff --git a/src/components/SettingsModal.vue b/src/components/SettingsModal.vue index 20259e9..16351c4 100644 --- a/src/components/SettingsModal.vue +++ b/src/components/SettingsModal.vue @@ -85,7 +85,7 @@ <label> <input type="checkbox" v-model="uiOpts.searchJumpMode" @change="onSettingChg('UI', 'searchJumpMode')"/> Skip search animation </label> </div> - <div v-if="!onTouchDevice"> + <div v-if="uiOpts.touchDevice == false"> <label> <input type="checkbox" v-model="uiOpts.disableShortcuts" @change="onSettingChg('UI', 'disableShortcuts')"/> Disable keyboard shortcuts </label> </div> @@ -109,7 +109,6 @@ import SButton from './SButton.vue'; import CloseIcon from './icon/CloseIcon.vue'; import {UiOptions, OptionType, getDefaultLytOpts, getDefaultUiOpts} from '../lib'; import {LayoutOptions} from '../layout'; -import {onTouchDevice} from '../util'; export default defineComponent({ props: { @@ -122,7 +121,6 @@ export default defineComponent({ // For making only two of 'layoutType's values available for user selection saved: false, // Set to true after a setting is saved settingChgTimeout: 0, // Use to throttle some setting-change handling - onTouchDevice: onTouchDevice(), }; }, computed: { diff --git a/src/components/Tile.vue b/src/components/Tile.vue index 7b24590..0105e57 100644 --- a/src/components/Tile.vue +++ b/src/components/Tile.vue @@ -426,7 +426,7 @@ export default defineComponent({ // Click handling onMouseDown(): void { this.highlight = false; - if (!this.uiOpts.useDblClick){ + if (!this.uiOpts.touchDevice){ // Wait for a mouseup or click-hold clearTimeout(this.clickHoldTimer); this.clickHoldTimer = setTimeout(() => { @@ -448,7 +448,7 @@ export default defineComponent({ } }, onMouseUp(): void { - if (!this.uiOpts.useDblClick){ + if (!this.uiOpts.touchDevice){ if (this.clickHoldTimer > 0){ clearTimeout(this.clickHoldTimer); this.clickHoldTimer = 0; @@ -108,8 +108,8 @@ export type UiOptions = { searchJumpMode: boolean, tutorialSkip: boolean, disabledActions: Set<Action>, - useDblClick: boolean, disableShortcuts: boolean, + touchDevice: boolean, }; // Option defaults export function getDefaultLytOpts(): LayoutOptions { @@ -169,8 +169,8 @@ export function getDefaultUiOpts(lytOpts: LayoutOptions): UiOptions { searchJumpMode: false, tutorialSkip: false, disabledActions: new Set() as Set<Action>, - useDblClick: onTouchDevice(), disableShortcuts: false, + touchDevice: onTouchDevice(), }; } // Used in Settings.vue, and when saving to localStorage |
