mirror of
https://github.com/aelve/guide.git
synced 2024-11-29 14:35:35 +03:00
Confirm discarding markdown editor unsaved changes shortcuts
This commit is contained in:
parent
0dd1eae726
commit
1422b4392d
@ -1,4 +1,3 @@
|
||||
<!-- Universal confirmation dialog, just pass text and function in Props -->
|
||||
<template>
|
||||
<v-dialog
|
||||
:value="value"
|
||||
@ -6,6 +5,8 @@
|
||||
max-width="500px"
|
||||
v-bind="$attrs"
|
||||
@input="cancel"
|
||||
@keydown.esc.stop="cancel"
|
||||
@keydown.enter.stop=""
|
||||
>
|
||||
|
||||
<template
|
||||
@ -74,6 +75,13 @@ export default class ConfirmDialog extends Vue {
|
||||
@Prop(Object) confirmBtnProps!: object
|
||||
@Prop(Object) cancelBtnProps!: object
|
||||
|
||||
test (event: Event) {
|
||||
event.stopPropagation()
|
||||
event.stopImmediatePropagation()
|
||||
event.preventDefault()
|
||||
console.log('ENTER FOCKIN CAPTURED')
|
||||
}
|
||||
|
||||
close () {
|
||||
this.$emit('input', false)
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
'markdown-editor_has-bottom-toolbar': bottomToolbar,
|
||||
'markdown-editor_has-top-toolbar': toolbar
|
||||
}"
|
||||
@keydown.exact.capture.enter="onEnterDown"
|
||||
@keydown.exact.enter="onEnterDown"
|
||||
@keydown.exact.ctrl.enter="onCtrlEnterDown"
|
||||
@keydown.exact.meta.enter="onCtrlEnterDown"
|
||||
@keydown.exact.esc="onEsc"
|
||||
@ -240,7 +240,9 @@ export default class MarkdownEditor extends Vue {
|
||||
}
|
||||
if (isConfirmed) {
|
||||
this.cancel()
|
||||
return
|
||||
}
|
||||
this.focusInputArea()
|
||||
}
|
||||
|
||||
cancel () {
|
||||
|
Loading…
Reference in New Issue
Block a user