Skip to content

Commit 056d12e

Browse files
committed
abort creation/edit of note on [esc]
1 parent 1be743d commit 056d12e

File tree

7 files changed

+35
-3
lines changed

7 files changed

+35
-3
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ For detailed explanation on how things work, check out [Nuxt.js docs](https://nu
6565
## Changelog
6666

6767
### 0.9.17
68+
* abort creation/edit of note while typing [ESC]
69+
* autofocus the first text element on copy dialog for template notes
6870
* fix crash when try to create new placeholder
6971
* preselect board tags on new notes [#31](https://github.com/rainu/dev-notes/issues/31)
7072
* UX: redesign themes

nuxt.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export default {
8080
plugins: [
8181
'~/plugins/localStore',
8282
'~/plugins/i18n',
83+
'~/plugins/shortkey',
8384
'~/plugins/init',
8485
'~/plugins/style',
8586
'~/plugins/notification',

package-lock.json

+20-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"uuid4": "^1.1.4",
2727
"vue-i18n": "^8.14.0",
2828
"vue-markdown": "^2.2.4",
29+
"vue-shortkey": "^3.1.7",
2930
"vue-web-cam": "^1.8.0",
3031
"vuedraggable": "^2.23.1",
3132
"webdav": "^2.10.0"

pages/notes/edit/_id.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</v-card-text>
1515
<v-card-actions>
1616
<div class="flex-grow-1"></div>
17-
<v-btn color="error" @click="onAbort">{{$t('note.actions.abort')}}</v-btn>
17+
<v-btn color="error" @click="onAbort" v-shortkey="['esc']" @shortkey="onAbort">{{$t('note.actions.abort')}}</v-btn>
1818
<v-btn color="primary" type="submit" form="note-edit-form">{{$t('note.actions.save')}}</v-btn>
1919
</v-card-actions>
2020
</v-card>

pages/notes/new/_type.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</v-card-text>
2323
<v-card-actions>
2424
<div class="flex-grow-1"></div>
25-
<v-btn color="error" @click="onAbort">{{$t('note.actions.abort')}}</v-btn>
25+
<v-btn color="error" @click="onAbort" v-shortkey="['esc']" @shortkey="onAbort">{{$t('note.actions.abort')}}</v-btn>
2626
<v-btn color="primary" type="submit" form="note-new-form">{{$t('note.actions.save')}}</v-btn>
2727
</v-card-actions>
2828
</v-card>

plugins/shortkey.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Vue from 'vue'
2+
3+
import shortkey from 'vue-shortkey'
4+
5+
Vue.use(shortkey)
6+
7+
export default ({ app, store }) => {
8+
9+
}

0 commit comments

Comments
 (0)