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