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-05 18:58:01 +0300
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-05 20:34:13 +0300
commit5e3fa0255341fea8d0842453ff034c3bf5f00ba2 (patch)
tree44f08bdd9599641786b7fe2183715efa72af2cef /app/assets/javascripts/gl_form.js
parent2b92f91038ad24a2ff3a6607f826cd8e518d8aa2 (diff)
Added resolvable discussion frontend
Diffstat (limited to 'app/assets/javascripts/gl_form.js')
-rw-r--r--app/assets/javascripts/gl_form.js16
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 () {