summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/templates
diff options
context:
space:
mode:
authorBryce Johnson <bryce@gitlab.com>2017-03-07 19:04:20 -0500
committerBryce Johnson <bryce@gitlab.com>2017-03-22 20:10:54 -0400
commitfaf7865c269044ea49f64858f60a8bd33a715727 (patch)
tree8c9623712de828376729107538a66dd91d982f81 /app/assets/javascripts/templates
parent1af9dfb8a8b163d70a8631a6cbb564709d5a3730 (diff)
downloadgitlab-ce-faf7865c269044ea49f64858f60a8bd33a715727.tar.gz
Lightly refactor js files related to file template selectors.
Diffstat (limited to 'app/assets/javascripts/templates')
-rw-r--r--app/assets/javascripts/templates/issuable_template_selector.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/app/assets/javascripts/templates/issuable_template_selector.js b/app/assets/javascripts/templates/issuable_template_selector.js
index e9e9aafd71a..32067ed1fee 100644
--- a/app/assets/javascripts/templates/issuable_template_selector.js
+++ b/app/assets/javascripts/templates/issuable_template_selector.js
@@ -1,15 +1,15 @@
/* eslint-disable comma-dangle, max-len, no-useless-return, no-param-reassign, max-len */
/* global Api */
-require('../blob/template_selector');
+import TemplateSelector from '../blob/template_selectors/template_selector';
((global) => {
- class IssuableTemplateSelector extends gl.TemplateSelector {
+ class IssuableTemplateSelector extends TemplateSelector {
constructor(...args) {
super(...args);
this.projectPath = this.dropdown.data('project-path');
this.namespacePath = this.dropdown.data('namespace-path');
- this.issuableType = this.wrapper.data('issuable-type');
+ this.issuableType = this.$dropdownContainer.data('issuable-type');
this.titleInput = $(`#${this.issuableType}_title`);
const initialQuery = {
@@ -41,16 +41,16 @@ require('../blob/template_selector');
}
setInputValueToTemplateContent() {
- // `this.requestFileSuccess` sets the value of the description input field
+ // `this.setEditorContent` sets the value of the description input field
// to the content of the template selected.
if (this.titleInput.val() === '') {
// If the title has not yet been set, focus the title input and
// skip focusing the description input by setting `true` as the
- // `skipFocus` option to `requestFileSuccess`.
- this.requestFileSuccess(this.currentTemplate, { skipFocus: true });
+ // `skipFocus` option to `setEditorContent`.
+ this.setEditorContent(this.currentTemplate, { skipFocus: true });
this.titleInput.focus();
} else {
- this.requestFileSuccess(this.currentTemplate, { skipFocus: false });
+ this.setEditorContent(this.currentTemplate, { skipFocus: false });
}
return;
}