diff options
Diffstat (limited to 'app/assets/javascripts/issue_show/components/description.vue')
-rw-r--r-- | app/assets/javascripts/issue_show/components/description.vue | 79 |
1 files changed, 56 insertions, 23 deletions
diff --git a/app/assets/javascripts/issue_show/components/description.vue b/app/assets/javascripts/issue_show/components/description.vue index 4ad3eb7dfd7..1fe3df28872 100644 --- a/app/assets/javascripts/issue_show/components/description.vue +++ b/app/assets/javascripts/issue_show/components/description.vue @@ -1,5 +1,6 @@ <script> import animateMixin from '../mixins/animate'; + import descriptionField from './fields/description.vue'; export default { mixins: [animateMixin], @@ -8,41 +9,53 @@ type: Boolean, required: true, }, - descriptionHtml: { - type: String, + store: { + type: Object, required: true, }, - descriptionText: { - type: String, + showForm: { + type: Boolean, required: true, }, - updatedAt: { +<<<<<<< HEAD + markdownPreviewUrl: { type: String, required: true, }, + markdownDocs: { +======= taskStatus: { +>>>>>>> 07c984d... Port fix-realtime-edited-text-for-issues 9-2-stable fix to master. type: String, required: true, }, }, data() { return { + state: this.store.state, preAnimation: false, pulseAnimation: false, - timeAgoEl: $('.js-issue-edited-ago'), }; }, + computed: { + descriptionHtml() { + return this.state.descriptionHtml; + }, + descriptionText() { + return this.state.descriptionText; + }, + updatedAt() { + return this.state.updated_at; + }, + taskStatus() { + return this.state.taskStatus; + }, + }, watch: { descriptionHtml() { this.animateChange(); this.$nextTick(() => { - const toolTipTime = gl.utils.formatDate(this.updatedAt); - - this.timeAgoEl.attr('datetime', this.updatedAt) - .attr('title', toolTipTime) - .tooltip('fixTitle'); - this.renderGFM(); }); }, @@ -75,6 +88,9 @@ } }, }, + components: { + descriptionField, + }, mounted() { this.renderGFM(); }, @@ -82,24 +98,41 @@ </script> <template> +<<<<<<< HEAD + <div :class="{ 'common-note-form': showForm }"> + <description-field + v-if="showForm" + :store="store" + :markdown-preview-url="markdownPreviewUrl" + :markdown-docs="markdownDocs" /> +======= <div + v-if="descriptionHtml" class="description" :class="{ 'js-task-list-container': canUpdate }"> +>>>>>>> f53d703... Fixed else-if in description <div - class="wiki" + v-else-if="descriptionHtml" + class="description" :class="{ - 'issue-realtime-pre-pulse': preAnimation, - 'issue-realtime-trigger-pulse': pulseAnimation - }" - v-html="descriptionHtml" - ref="gfm-content"> + 'js-task-list-container': canUpdate + }"> + <div + class="wiki" + :class="{ + 'issue-realtime-pre-pulse': preAnimation, + 'issue-realtime-trigger-pulse': pulseAnimation + }" + v-html="descriptionHtml" + ref="gfm-content"> + </div> + <textarea + class="hidden js-task-list-field" + v-if="descriptionText" + v-model="descriptionText"> + </textarea> </div> - <textarea - class="hidden js-task-list-field" - v-if="descriptionText" - v-model="descriptionText"> - </textarea> </div> </template> |