mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-22 09:25:53 +08:00
Switch check from !isMac to isWindows for specificity.
Only Windows uses Mod+y, this avoids adding the shortcut to other operating systems (such as Linux or iOS). This adds better support for spoofed user-agents when testing mobile sites on desktop devices. You could also add `|| /Pocket/.test(navigator.platform)` but it really is optional
This commit is contained in:
parent
8aa39d1393
commit
8c9676402b
@ -15,13 +15,13 @@ export default class History extends Extension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
keys() {
|
keys() {
|
||||||
const isMac = typeof navigator !== 'undefined' ? /Mac/.test(navigator.platform) : false
|
const isWindows = typeof navigator !== 'undefined' ? /Win/.test(navigator.platform) : false
|
||||||
const keymap = {
|
const keymap = {
|
||||||
'Mod-z': undo,
|
'Mod-z': undo,
|
||||||
'Shift-Mod-z': redo,
|
'Shift-Mod-z': redo,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isMac) {
|
if (isWindows) {
|
||||||
keymap['Mod-y'] = redo
|
keymap['Mod-y'] = redo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user