BigW Consortium Gitlab

Commit 29fd1305 by Phil Hughes

enable meta+enter shortcut to quick submit

parent df7c9011
<script> <script>
import updateMixin from '../mixins/update';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
export default { export default {
mixins: [updateMixin],
props: { props: {
canDestroy: { canDestroy: {
type: Boolean, type: Boolean,
...@@ -23,10 +25,6 @@ ...@@ -23,10 +25,6 @@
}, },
}, },
methods: { methods: {
updateIssuable() {
this.formState.updateLoading = true;
eventHub.$emit('update.issuable');
},
closeForm() { closeForm() {
eventHub.$emit('close.form'); eventHub.$emit('close.form');
}, },
......
<script> <script>
/* global Flash */ /* global Flash */
import updateMixin from '../../mixins/update';
import markdownField from '../../../vue_shared/components/markdown/field.vue'; import markdownField from '../../../vue_shared/components/markdown/field.vue';
export default { export default {
mixins: [updateMixin],
props: { props: {
formState: { formState: {
type: Object, type: Object,
...@@ -44,7 +46,8 @@ ...@@ -44,7 +46,8 @@
v-model="formState.description" v-model="formState.description"
ref="textarea" ref="textarea"
slot="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> </textarea>
</markdown-field> </markdown-field>
</div> </div>
......
<script> <script>
import updateMixin from '../../mixins/update';
export default { export default {
mixins: [updateMixin],
props: { props: {
formState: { formState: {
type: Object, type: Object,
...@@ -22,6 +25,7 @@ ...@@ -22,6 +25,7 @@
type="text" type="text"
placeholder="Issue title" placeholder="Issue title"
aria-label="Issue title" aria-label="Issue title"
v-model="formState.title" /> v-model="formState.title"
@keydown.meta.enter="updateIssuable" />
</fieldset> </fieldset>
</template> </template>
import eventHub from '../event_hub';
export default {
methods: {
updateIssuable() {
this.formState.updateLoading = true;
eventHub.$emit('update.issuable');
},
},
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment