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 "Jared" Bennett <lbennett@gitlab.com>2017-04-07 17:31:14 +0300
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-07 17:31:14 +0300
commit99918be7312b11dd650924e39b2bf8b65a4004d8 (patch)
treedd4655ad0f2257b2ae20ceb36115ba479376f9d3 /app/assets/javascripts/comment_type_toggle.js
parent18e2388de19f47093cb3192f4b8dbabdd9c3bfad (diff)
Added variable button fix
Diffstat (limited to 'app/assets/javascripts/comment_type_toggle.js')
-rw-r--r--app/assets/javascripts/comment_type_toggle.js38
1 files changed, 21 insertions, 17 deletions
diff --git a/app/assets/javascripts/comment_type_toggle.js b/app/assets/javascripts/comment_type_toggle.js
index ba3b43b201d..de9dc5979a3 100644
--- a/app/assets/javascripts/comment_type_toggle.js
+++ b/app/assets/javascripts/comment_type_toggle.js
@@ -31,23 +31,27 @@ class CommentTypeToggle {
}],
};
- if (!this.closeButton || !this.reopenButton) return config;
-
- config.InputSetter.push({
- input: this.closeButton,
- valueAttribute: 'data-close-text',
- }, {
- input: this.closeButton,
- valueAttribute: 'data-close-text',
- inputAttribute: 'data-alternative-text',
- }, {
- input: this.reopenButton,
- valueAttribute: 'data-reopen-text',
- }, {
- input: this.reopenButton,
- valueAttribute: 'data-reopen-text',
- inputAttribute: 'data-alternative-text',
- });
+ if (this.closeButton) {
+ config.InputSetter.push({
+ input: this.closeButton,
+ valueAttribute: 'data-close-text',
+ }, {
+ input: this.closeButton,
+ valueAttribute: 'data-close-text',
+ inputAttribute: 'data-alternative-text',
+ });
+ }
+
+ if (this.reopenButton) {
+ config.InputSetter.push({
+ input: this.reopenButton,
+ valueAttribute: 'data-reopen-text',
+ }, {
+ input: this.reopenButton,
+ valueAttribute: 'data-reopen-text',
+ inputAttribute: 'data-alternative-text',
+ });
+ }
return config;
}