Skip to content

Commit

Permalink
Improve cmd+enter experience with issues #76
Browse files Browse the repository at this point in the history
  • Loading branch information
blackchestnut committed Dec 11, 2021
1 parent 53346c7 commit 4bd12ce
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/components/board/issue_new.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<GlobalEvents
:filter="(event, handler, eventName) => event.target.tagName !== 'INPUT' && event.target.tagName !== 'TEXTAREA'"
@keyup.esc='close'
@keydown.esc='close'
/>
<div class='issue'>
<div class='issue-header' :style='headerBackgroundColor'>
Expand All @@ -22,15 +22,16 @@
placeholder='Title'
:disabled='isReadonly'
ref='title'
@keyup.enter='submit'
@keyup.esc='close'
@keydown.enter='submit'
@keydown.esc='close'
/>

<MarkdownEditor
v-model='body'
:assignable-users='assignableUsers'
:disabled='isReadonly'
class='body'
@submit='submit'
/>

<div class='actions'>
Expand Down
10 changes: 8 additions & 2 deletions src/components/board/issue_show.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<GlobalEvents
v-if='isLoaded'
:filter="(event, handler, eventName) => event.target.tagName !== 'INPUT'"
@keyup.esc='close'
@keydown.esc='close'
/>
<div v-if='isNotFound' class='issue'>
<div class='issue-header'>
Expand Down Expand Up @@ -310,7 +310,13 @@ export default {
'issue/fetchComments',
'issue/createComment'
]),
close() { this.$emit('close'); },
close() {
if (this.isEditBody) {
this.isEditBody = false;
} else {
this.$emit('close');
}
},
async fetchIssue() {
await this.fetch({ id: this.id });
this.newBody = this.fetchedIssue.body;
Expand Down
2 changes: 1 addition & 1 deletion src/components/board/issues/title.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<input
type='text'
v-model='newTitle'
@keyup.enter='save'
@keydown.enter='save'
@keyup.esc='cancel'
ref='title'
/>
Expand Down

0 comments on commit 4bd12ce

Please sign in to comment.