summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-05-30 12:08:49 +0100
committerPhil Hughes <me@iamphill.com>2017-05-30 12:08:49 +0100
commit29fd13056b34477abb142bf0380186eff6dd066a (patch)
tree3ffac6ccc26037aa589cbf99a322e0925fa1ce8c
parentdf7c90116ba1203f1cb1150bb99fa5a4c99e0280 (diff)
downloadgitlab-ce-29fd13056b34477abb142bf0380186eff6dd066a.tar.gz
enable meta+enter shortcut to quick submitissue-edit-inline
-rw-r--r--app/assets/javascripts/issue_show/components/edit_actions.vue6
-rw-r--r--app/assets/javascripts/issue_show/components/fields/description.vue5
-rw-r--r--app/assets/javascripts/issue_show/components/fields/title.vue6
-rw-r--r--app/assets/javascripts/issue_show/mixins/update.js10
4 files changed, 21 insertions, 6 deletions
diff --git a/app/assets/javascripts/issue_show/components/edit_actions.vue b/app/assets/javascripts/issue_show/components/edit_actions.vue
index 0750d21c15d..8c81575fe6f 100644
--- a/app/assets/javascripts/issue_show/components/edit_actions.vue
+++ b/app/assets/javascripts/issue_show/components/edit_actions.vue
@@ -1,7 +1,9 @@
<script>
+ import updateMixin from '../mixins/update';
import eventHub from '../event_hub';
export default {
+ mixins: [updateMixin],
props: {
canDestroy: {
type: Boolean,
@@ -23,10 +25,6 @@
},
},
methods: {
- updateIssuable() {
- this.formState.updateLoading = true;
- eventHub.$emit('update.issuable');
- },
closeForm() {
eventHub.$emit('close.form');
},
diff --git a/app/assets/javascripts/issue_show/components/fields/description.vue b/app/assets/javascripts/issue_show/components/fields/description.vue
index 733cc7eab6c..30a1be5cb50 100644
--- a/app/assets/javascripts/issue_show/components/fields/description.vue
+++ b/app/assets/javascripts/issue_show/components/fields/description.vue
@@ -1,8 +1,10 @@
<script>
/* global Flash */
+ import updateMixin from '../../mixins/update';
import markdownField from '../../../vue_shared/components/markdown/field.vue';
export default {
+ mixins: [updateMixin],
props: {
formState: {
type: Object,
@@ -44,7 +46,8 @@
v-model="formState.description"
ref="textarea"
slot="textarea"
- placeholder="Write a comment or drag your files here...">
+ placeholder="Write a comment or drag your files here..."
+ @keydown.meta.enter="updateIssuable">
</textarea>
</markdown-field>
</div>
diff --git a/app/assets/javascripts/issue_show/components/fields/title.vue b/app/assets/javascripts/issue_show/components/fields/title.vue
index 01ae6fd3dd2..6556bf117e2 100644
--- a/app/assets/javascripts/issue_show/components/fields/title.vue
+++ b/app/assets/javascripts/issue_show/components/fields/title.vue
@@ -1,5 +1,8 @@
<script>
+ import updateMixin from '../../mixins/update';
+
export default {
+ mixins: [updateMixin],
props: {
formState: {
type: Object,
@@ -22,6 +25,7 @@
type="text"
placeholder="Issue title"
aria-label="Issue title"
- v-model="formState.title" />
+ v-model="formState.title"
+ @keydown.meta.enter="updateIssuable" />
</fieldset>
</template>
diff --git a/app/assets/javascripts/issue_show/mixins/update.js b/app/assets/javascripts/issue_show/mixins/update.js
new file mode 100644
index 00000000000..72be65b426f
--- /dev/null
+++ b/app/assets/javascripts/issue_show/mixins/update.js
@@ -0,0 +1,10 @@
+import eventHub from '../event_hub';
+
+export default {
+ methods: {
+ updateIssuable() {
+ this.formState.updateLoading = true;
+ eventHub.$emit('update.issuable');
+ },
+ },
+};