debian-mirror-gitlab/app/assets/javascripts/issue_show/components/fields/description.vue

67 lines
1.5 KiB
Vue
Raw Normal View History

2017-09-10 17:25:29 +05:30
<script>
2018-12-13 13:39:08 +05:30
import updateMixin from '../../mixins/update';
import markdownField from '../../../vue_shared/components/markdown/field.vue';
2017-09-10 17:25:29 +05:30
2018-12-13 13:39:08 +05:30
export default {
components: {
markdownField,
},
mixins: [updateMixin],
props: {
formState: {
type: Object,
required: true,
2018-03-17 18:26:18 +05:30
},
2018-12-13 13:39:08 +05:30
markdownPreviewPath: {
type: String,
required: true,
2017-09-10 17:25:29 +05:30
},
2018-12-13 13:39:08 +05:30
markdownDocsPath: {
type: String,
required: true,
2017-09-10 17:25:29 +05:30
},
2018-12-13 13:39:08 +05:30
canAttachFile: {
type: Boolean,
required: false,
default: true,
},
enableAutocomplete: {
type: Boolean,
required: false,
default: true,
},
},
mounted() {
this.$refs.textarea.focus();
},
};
2017-09-10 17:25:29 +05:30
</script>
<template>
<div class="common-note-form">
2019-02-15 15:39:39 +05:30
<label class="sr-only" for="issue-description"> Description </label>
2017-09-10 17:25:29 +05:30
<markdown-field
2018-03-17 18:26:18 +05:30
:markdown-preview-path="markdownPreviewPath"
:markdown-docs-path="markdownDocsPath"
:can-attach-file="canAttachFile"
:enable-autocomplete="enableAutocomplete"
>
2017-09-10 17:25:29 +05:30
<textarea
id="issue-description"
2018-11-08 19:23:39 +05:30
ref="textarea"
slot="textarea"
v-model="formState.description"
2018-12-05 23:21:45 +05:30
class="note-textarea js-gfm-input js-autosize markdown-area
qa-description-textarea"
2019-07-31 22:56:46 +05:30
dir="auto"
2018-03-17 18:26:18 +05:30
data-supports-quick-actions="false"
2017-09-10 17:25:29 +05:30
aria-label="Description"
2018-11-08 19:23:39 +05:30
placeholder="Write a comment or drag your files here…"
2017-09-10 17:25:29 +05:30
@keydown.meta.enter="updateIssuable"
2019-02-15 15:39:39 +05:30
@keydown.ctrl.enter="updateIssuable"
>
2017-09-10 17:25:29 +05:30
</textarea>
</markdown-field>
</div>
</template>