summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-05-22 09:08:39 +0100
committerPhil Hughes <me@iamphill.com>2017-05-22 09:08:39 +0100
commit17617a32bdf5df5d8a9e2153eccde2a24e1cc77c (patch)
tree6f8a6baf9d072e52a521512ff1dd9e0b99d9cb80
parent7a21e26f4b1243a48e6e31f2b9af6e525ae8ca30 (diff)
downloadgitlab-ce-issue-edit-inline-description-template.tar.gz
Moved value into computed propertyissue-edit-inline-description-template
Changed jQuery selector into document.querySelector [ci skip]
-rw-r--r--app/assets/javascripts/issue_show/components/fields/description_template.vue9
-rw-r--r--app/assets/javascripts/issue_show/components/form.vue5
-rw-r--r--app/assets/javascripts/issue_show/index.js1
3 files changed, 9 insertions, 6 deletions
diff --git a/app/assets/javascripts/issue_show/components/fields/description_template.vue b/app/assets/javascripts/issue_show/components/fields/description_template.vue
index 7bd3c79b03e..540c8f64c21 100644
--- a/app/assets/javascripts/issue_show/components/fields/description_template.vue
+++ b/app/assets/javascripts/issue_show/components/fields/description_template.vue
@@ -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>
diff --git a/app/assets/javascripts/issue_show/components/form.vue b/app/assets/javascripts/issue_show/components/form.vue
index 0c8c972ff31..e0a603f61d4 100644
--- a/app/assets/javascripts/issue_show/components/form.vue
+++ b/app/assets/javascripts/issue_show/components/form.vue
@@ -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;
},
},
};
diff --git a/app/assets/javascripts/issue_show/index.js b/app/assets/javascripts/issue_show/index.js
index 3b4e5c5488c..790194db57f 100644
--- a/app/assets/javascripts/issue_show/index.js
+++ b/app/assets/javascripts/issue_show/index.js
@@ -49,6 +49,7 @@ document.addEventListener('DOMContentLoaded', () => {
projectPath: initialData.project_path,
projectNamespace: initialData.namespace_path,
projectsAutocompleteUrl,
+ issuableTemplates: initialData.templates,
};
},
render(createElement) {