diff options
author | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-05 16:58:01 +0100 |
---|---|---|
committer | Luke "Jared" Bennett <lbennett@gitlab.com> | 2017-04-05 18:34:13 +0100 |
commit | 5e3fa0255341fea8d0842453ff034c3bf5f00ba2 (patch) | |
tree | 44f08bdd9599641786b7fe2183715efa72af2cef /app/assets/javascripts/gl_form.js | |
parent | 2b92f91038ad24a2ff3a6607f826cd8e518d8aa2 (diff) | |
download | gitlab-ce-5e3fa0255341fea8d0842453ff034c3bf5f00ba2.tar.gz |
Added resolvable discussion frontend
Diffstat (limited to 'app/assets/javascripts/gl_form.js')
-rw-r--r-- | app/assets/javascripts/gl_form.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/assets/javascripts/gl_form.js b/app/assets/javascripts/gl_form.js index e7c98e16581..06072faa472 100644 --- a/app/assets/javascripts/gl_form.js +++ b/app/assets/javascripts/gl_form.js @@ -3,6 +3,8 @@ /* global DropzoneInput */ /* global autosize */ +import CommentTypeToggle from './comment_type_toggle'; + window.gl = window.gl || {}; function GLForm(form) { @@ -41,6 +43,20 @@ GLForm.prototype.setupForm = function() { this.form.find('.js-note-discard').hide(); this.form.show(); if (this.isAutosizeable) this.setupAutosize(); + + this.initCommentTypeToggle(); +}; + +GLForm.prototype.initCommentTypeToggle = function () { + this.commentTypeToggle = new CommentTypeToggle( + this.form[0].querySelector('.js-comment-type-dropdown .dropdown-toggle'), + this.form[0].querySelector('.js-comment-type-dropdown .dropdown-menu'), + document.getElementById('note_type'), + this.form[0].querySelector('.js-comment-type-dropdown .js-comment-submit-button'), + document.querySelector('.js-note-target-close'), + ); + + this.commentTypeToggle.initDroplab(); }; GLForm.prototype.setupAutosize = function () { |