mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
fix preventDefault
This commit is contained in:
parent
3586ba9d8b
commit
8b165ae8d3
@ -286,6 +286,7 @@ class App {
|
||||
window.app.ShortcutsController.register({
|
||||
key: ",",
|
||||
meta: true,
|
||||
preventDefault: true,
|
||||
}, (...args) => {
|
||||
App.publicMethods.openSettings(...args)
|
||||
})
|
||||
@ -293,6 +294,7 @@ class App {
|
||||
window.app.ShortcutsController.register({
|
||||
key: ",",
|
||||
ctrl: true,
|
||||
preventDefault: true,
|
||||
}, (...args) => {
|
||||
App.publicMethods.openSettings(...args)
|
||||
})
|
||||
|
@ -8,8 +8,6 @@ export class ShortcutsController {
|
||||
const shortcut = this.shortcuts[key]
|
||||
|
||||
if (shortcut) {
|
||||
event.preventDefault()
|
||||
|
||||
if (typeof shortcut.ctrl === "boolean" && event.ctrlKey !== shortcut.ctrl) {
|
||||
return
|
||||
}
|
||||
@ -17,14 +15,18 @@ export class ShortcutsController {
|
||||
if (typeof shortcut.shift === "boolean" && event.shiftKey !== shortcut.shift) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if (typeof shortcut.alt === "boolean" && event.altKey !== shortcut.alt) {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
if (typeof shortcut.meta === "boolean" && event.metaKey !== shortcut.meta) {
|
||||
return
|
||||
}
|
||||
|
||||
if (shortcut.preventDefault) {
|
||||
event.preventDefault()
|
||||
}
|
||||
|
||||
if (typeof shortcut.fn === "function") {
|
||||
shortcut.fn()
|
||||
|
Loading…
x
Reference in New Issue
Block a user