diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-07 15:31:14 +0100 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-07 15:31:14 +0100 |
commit | 99918be7312b11dd650924e39b2bf8b65a4004d8 (patch) | |
tree | dd4655ad0f2257b2ae20ceb36115ba479376f9d3 /app/assets/javascripts/comment_type_toggle.js | |
parent | 18e2388de19f47093cb3192f4b8dbabdd9c3bfad (diff) | |
download | gitlab-ce-99918be7312b11dd650924e39b2bf8b65a4004d8.tar.gz |
Added variable button fix
Diffstat (limited to 'app/assets/javascripts/comment_type_toggle.js')
-rw-r--r-- | app/assets/javascripts/comment_type_toggle.js | 38 |
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; } |