Moved value into computed property
Changed jQuery selector into document.querySelector [ci skip]
This commit is contained in:
parent
7a21e26f4b
commit
17617a32bd
3 changed files with 9 additions and 6 deletions
|
@ -19,9 +19,14 @@
|
|||
required: true,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
issuableTemplatesJson() {
|
||||
return JSON.stringify(this.issuableTemplates);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// 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) => {
|
||||
this.formState.description = val;
|
||||
};
|
||||
|
@ -48,7 +53,7 @@
|
|||
data-toggle="dropdown"
|
||||
:data-namespace-path="projectNamespace"
|
||||
:data-project-path="projectPath"
|
||||
:data-data="JSON.stringify(issuableTemplates)">
|
||||
:data-data="issuableTemplatesJson">
|
||||
<span class="dropdown-toggle-text">
|
||||
Choose a template
|
||||
</span>
|
||||
|
|
|
@ -2,11 +2,8 @@
|
|||
import titleField from './fields/title.vue';
|
||||
import descriptionField from './fields/description.vue';
|
||||
import editActions from './edit_actions.vue';
|
||||
<<<<<<< HEAD
|
||||
import descriptionTemplate from './fields/description_template.vue';
|
||||
=======
|
||||
import projectMove from './fields/project_move.vue';
|
||||
>>>>>>> issue-edit-inline
|
||||
import confidentialCheckbox from './fields/confidential_checkbox.vue';
|
||||
|
||||
export default {
|
||||
|
@ -59,7 +56,7 @@
|
|||
},
|
||||
computed: {
|
||||
hasIssuableTemplates() {
|
||||
return this.issuableTemplates.length !== 0;
|
||||
return this.issuableTemplates.length;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -49,6 +49,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||
projectPath: initialData.project_path,
|
||||
projectNamespace: initialData.namespace_path,
|
||||
projectsAutocompleteUrl,
|
||||
issuableTemplates: initialData.templates,
|
||||
};
|
||||
},
|
||||
render(createElement) {
|
||||
|
|
Loading…
Reference in a new issue