BigW Consortium Gitlab

Commit 17617a32 by Phil Hughes

Moved value into computed property

Changed jQuery selector into document.querySelector [ci skip]
parent 7a21e26f
...@@ -19,9 +19,14 @@ ...@@ -19,9 +19,14 @@
required: true, required: true,
}, },
}, },
computed: {
issuableTemplatesJson() {
return JSON.stringify(this.issuableTemplates);
},
},
mounted() { mounted() {
// Create the editor for the template // Create the editor for the template
const editor = $('.detail-page-description .note-textarea'); const editor = document.querySelector('.detail-page-description .note-textarea');
editor.setValue = (val) => { editor.setValue = (val) => {
this.formState.description = val; this.formState.description = val;
}; };
...@@ -48,7 +53,7 @@ ...@@ -48,7 +53,7 @@
data-toggle="dropdown" data-toggle="dropdown"
:data-namespace-path="projectNamespace" :data-namespace-path="projectNamespace"
:data-project-path="projectPath" :data-project-path="projectPath"
:data-data="JSON.stringify(issuableTemplates)"> :data-data="issuableTemplatesJson">
<span class="dropdown-toggle-text"> <span class="dropdown-toggle-text">
Choose a template Choose a template
</span> </span>
......
...@@ -2,11 +2,8 @@ ...@@ -2,11 +2,8 @@
import titleField from './fields/title.vue'; import titleField from './fields/title.vue';
import descriptionField from './fields/description.vue'; import descriptionField from './fields/description.vue';
import editActions from './edit_actions.vue'; import editActions from './edit_actions.vue';
<<<<<<< HEAD
import descriptionTemplate from './fields/description_template.vue'; import descriptionTemplate from './fields/description_template.vue';
=======
import projectMove from './fields/project_move.vue'; import projectMove from './fields/project_move.vue';
>>>>>>> issue-edit-inline
import confidentialCheckbox from './fields/confidential_checkbox.vue'; import confidentialCheckbox from './fields/confidential_checkbox.vue';
export default { export default {
...@@ -59,7 +56,7 @@ ...@@ -59,7 +56,7 @@
}, },
computed: { computed: {
hasIssuableTemplates() { hasIssuableTemplates() {
return this.issuableTemplates.length !== 0; return this.issuableTemplates.length;
}, },
}, },
}; };
......
...@@ -49,6 +49,7 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -49,6 +49,7 @@ document.addEventListener('DOMContentLoaded', () => {
projectPath: initialData.project_path, projectPath: initialData.project_path,
projectNamespace: initialData.namespace_path, projectNamespace: initialData.namespace_path,
projectsAutocompleteUrl, projectsAutocompleteUrl,
issuableTemplates: initialData.templates,
}; };
}, },
render(createElement) { render(createElement) {
......
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