Commit 598b05df authored by Phil Hughes's avatar Phil Hughes

Fixed a bunch of errors with invalid prop

Use v-model on textrea
parent 3313df58
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
}, },
data() { data() {
const store = new Store({ const store = new Store({
title: this.initialTitle, titleHtml: this.initialTitle,
descriptionHtml: this.initialDescriptionHtml, descriptionHtml: this.initialDescriptionHtml,
descriptionText: this.initialDescriptionText, descriptionText: this.initialDescriptionText,
}); });
...@@ -86,6 +86,7 @@ export default { ...@@ -86,6 +86,7 @@ export default {
:title-html="state.titleHtml" :title-html="state.titleHtml"
:title-text="state.titleText" /> :title-text="state.titleText" />
<description-component <description-component
v-if="state.descriptionHtml"
:can-update="canUpdate" :can-update="canUpdate"
:description-html="state.descriptionHtml" :description-html="state.descriptionHtml"
:description-text="state.descriptionText" :description-text="state.descriptionText"
......
...@@ -43,16 +43,7 @@ ...@@ -43,16 +43,7 @@
.attr('title', toolTipTime) .attr('title', toolTipTime)
.tooltip('fixTitle'); .tooltip('fixTitle');
$(this.$refs['gfm-entry-content']).renderGFM(); this.renderGFM();
if (this.canUpdate) {
// eslint-disable-next-line no-new
new gl.TaskList({
dataType: 'issue',
fieldName: 'description',
selector: '.detail-page-description',
});
}
}); });
}, },
taskStatus() { taskStatus() {
...@@ -77,17 +68,32 @@ ...@@ -77,17 +68,32 @@
} }
}, },
}, },
methods: {
renderGFM() {
$(this.$refs['gfm-entry-content']).renderGFM();
if (this.canUpdate) {
// eslint-disable-next-line no-new
new gl.TaskList({
dataType: 'issue',
fieldName: 'description',
selector: '.detail-page-description',
});
}
},
},
mounted() {
this.renderGFM();
},
}; };
</script> </script>
<template> <template>
<div <div
v-if="descriptionHtml"
class="description" class="description"
:class="{ :class="{
'js-task-list-container': canUpdate 'js-task-list-container': canUpdate
}" }">
>
<div <div
class="wiki" class="wiki"
:class="{ :class="{
...@@ -95,12 +101,12 @@ ...@@ -95,12 +101,12 @@
'issue-realtime-trigger-pulse': pulseAnimation 'issue-realtime-trigger-pulse': pulseAnimation
}" }"
v-html="descriptionHtml" v-html="descriptionHtml"
ref="gfm-content" ref="gfm-content">
>
</div> </div>
<textarea <textarea
class="hidden js-task-list-field" class="hidden js-task-list-field"
v-if="descriptionText" v-if="descriptionText"
>{{ descriptionText }}</textarea> v-model="descriptionText">
</textarea>
</div> </div>
</template> </template>
export default class Store { export default class Store {
constructor({ constructor({
title, titleHtml,
descriptionHtml, descriptionHtml,
descriptionText, descriptionText,
}) { }) {
this.state = { this.state = {
titleHtml: title, titleHtml,
titleText: '', titleText: '',
descriptionHtml, descriptionHtml,
descriptionText, descriptionText,
......
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