Merge pull request #1940 from acid-chicken/acid-chicken-patch-1

投稿できない際にショートカットキーをトリガーしないようにする
This commit is contained in:
syuilo 2018-07-21 02:16:11 +09:00 committed by GitHub
commit bc8bea11c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -119,7 +119,7 @@ export default Vue.extend({
},
onKeypress(e) {
if ((e.which == 10 || e.which == 13) && e.ctrlKey) {
if ((e.which == 10 || e.which == 13) && e.ctrlKey && this.canSend) {
this.send();
}
},

View File

@ -244,7 +244,7 @@ export default Vue.extend({
},
onKeydown(e) {
if ((e.which == 10 || e.which == 13) && (e.ctrlKey || e.metaKey)) this.post();
if ((e.which == 10 || e.which == 13) && (e.ctrlKey || e.metaKey) && this.canPost) this.post();
},
onPaste(e) {

View File

@ -45,7 +45,7 @@ export default define({
this.save();
},
onKeydown(e) {
if ((e.which == 10 || e.which == 13) && (e.ctrlKey || e.metaKey)) this.post();
if ((e.which == 10 || e.which == 13) && (e.ctrlKey || e.metaKey) && !this.posting && this.text) this.post();
},
post() {
this.posting = true;