mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-04-30 08:25:58 -05:00
fix: use shift+r for reminder shortcut on apple devices
This commit is contained in:
@@ -3,6 +3,7 @@ import type {RouteLocation} from 'vue-router'
|
|||||||
import {isAppleDevice} from '@/helpers/isAppleDevice'
|
import {isAppleDevice} from '@/helpers/isAppleDevice'
|
||||||
|
|
||||||
const ctrl = isAppleDevice() ? '⌘' : 'ctrl'
|
const ctrl = isAppleDevice() ? '⌘' : 'ctrl'
|
||||||
|
const reminderModifier = isAppleDevice() ? 'shift' : 'alt'
|
||||||
|
|
||||||
export interface Shortcut {
|
export interface Shortcut {
|
||||||
title: string
|
title: string
|
||||||
@@ -182,7 +183,7 @@ export const KEYBOARD_SHORTCUTS: ShortcutGroup[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'keyboardShortcuts.task.reminder',
|
title: 'keyboardShortcuts.task.reminder',
|
||||||
keys: ['alt', 'r'],
|
keys: [reminderModifier, 'r'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'keyboardShortcuts.task.description',
|
title: 'keyboardShortcuts.task.description',
|
||||||
|
|||||||
@@ -539,7 +539,7 @@
|
|||||||
{{ $t('task.detail.actions.endDate') }}
|
{{ $t('task.detail.actions.endDate') }}
|
||||||
</XButton>
|
</XButton>
|
||||||
<XButton
|
<XButton
|
||||||
v-shortcut="'Alt+r'"
|
v-shortcut="reminderShortcut"
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
:icon="['far', 'clock']"
|
:icon="['far', 'clock']"
|
||||||
@click="setFieldActive('reminders')"
|
@click="setFieldActive('reminders')"
|
||||||
@@ -640,6 +640,7 @@ import Reactions from '@/components/input/Reactions.vue'
|
|||||||
|
|
||||||
import {uploadFile} from '@/helpers/attachments'
|
import {uploadFile} from '@/helpers/attachments'
|
||||||
import {getProjectTitle} from '@/helpers/getProjectTitle'
|
import {getProjectTitle} from '@/helpers/getProjectTitle'
|
||||||
|
import {isAppleDevice} from '@/helpers/isAppleDevice'
|
||||||
import {scrollIntoView} from '@/helpers/scrollIntoView'
|
import {scrollIntoView} from '@/helpers/scrollIntoView'
|
||||||
import {TASK_REPEAT_MODES} from '@/types/IRepeatMode'
|
import {TASK_REPEAT_MODES} from '@/types/IRepeatMode'
|
||||||
import {playPopSound} from '@/helpers/playPop'
|
import {playPopSound} from '@/helpers/playPop'
|
||||||
@@ -710,6 +711,10 @@ const lastProject = computed(() => {
|
|||||||
|
|
||||||
const lastProjectOrTaskProject = computed(() => lastProject.value ?? project.value)
|
const lastProjectOrTaskProject = computed(() => lastProject.value ?? project.value)
|
||||||
|
|
||||||
|
// Use Shift+R on macOS (Alt+R produces special characters depending on keyboard layout)
|
||||||
|
// Use Alt+r on other platforms
|
||||||
|
const reminderShortcut = computed(() => isAppleDevice() ? 'Shift+R' : 'Alt+r')
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
document.addEventListener('keydown', saveTaskViaHotkey)
|
document.addEventListener('keydown', saveTaskViaHotkey)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user