Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2016-10-10 05:19:55 +0300
committerLuke Bennett <lukeeeebennettplus@gmail.com>2016-10-13 17:48:07 +0300
commitae851edc3c76fd7b81de2e3d48ec8a531f3609b3 (patch)
tree83681a2115462a02fd4aef747b8e3c73cb8ad8c9 /app/assets/javascripts/templates
parent2362dfee686ab715ef6a3bd00b389ab321e7a728 (diff)
Added no-template functionality
Added tests
Diffstat (limited to 'app/assets/javascripts/templates')
-rw-r--r--app/assets/javascripts/templates/issuable_template_selector.js.es68
1 files changed, 7 insertions, 1 deletions
diff --git a/app/assets/javascripts/templates/issuable_template_selector.js.es6 b/app/assets/javascripts/templates/issuable_template_selector.js.es6
index 2ecf3b18975..bd4e3c3d00d 100644
--- a/app/assets/javascripts/templates/issuable_template_selector.js.es6
+++ b/app/assets/javascripts/templates/issuable_template_selector.js.es6
@@ -16,7 +16,13 @@
if (initialQuery.name) this.requestFile(initialQuery);
$('.reset-template', this.dropdown.parent()).on('click', () => {
- if (this.currentTemplate) this.setInputValueToTemplateContent(false);
+ this.setInputValueToTemplateContent();
+ });
+
+ $('.no-template', this.dropdown.parent()).on('click', () => {
+ this.currentTemplate = '';
+ this.setInputValueToTemplateContent();
+ $('.dropdown-toggle-text', this.dropdown).text('Choose a template');
});
}