diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2017-10-05 16:52:49 +0300 |
---|---|---|
committer | Tim Zallmann <tzallmann@gitlab.com> | 2017-10-05 16:52:49 +0300 |
commit | 5725e347ebdf04481a4eb7f82ce5db8c32b209b6 (patch) | |
tree | 9fba56795d6a27e24231f0c4eb9a0b149d33e25d /app/assets/javascripts/gl_dropdown.js | |
parent | bf9bd0683d9184b33769954aad436f577967ee00 (diff) | |
parent | 91384251bbc675a3a5b4b16b781f2811d6cab959 (diff) |
Merge branch '32163-protected-branch-form-should-have-sane-defaults-for-dropdowns' into 'master'
Resolve "Protected branch form should have sane defaults for dropdowns"
Closes #32163
See merge request gitlab-org/gitlab-ce!14278
Diffstat (limited to 'app/assets/javascripts/gl_dropdown.js')
-rw-r--r-- | app/assets/javascripts/gl_dropdown.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js b/app/assets/javascripts/gl_dropdown.js index ff218ccad62..e8d8fef8579 100644 --- a/app/assets/javascripts/gl_dropdown.js +++ b/app/assets/javascripts/gl_dropdown.js @@ -738,7 +738,7 @@ GitLabDropdown = (function() { : selectedObject.id; if (isInput) { field = $(this.el); - } else if (value) { + } else if (value != null) { field = this.dropdown.parent().find("input[name='" + fieldName + "'][value='" + value.toString().replace(/'/g, '\\\'') + "']"); } @@ -746,7 +746,7 @@ GitLabDropdown = (function() { return; } - if (el.hasClass(ACTIVE_CLASS)) { + if (el.hasClass(ACTIVE_CLASS) && value !== 0) { isMarking = false; el.removeClass(ACTIVE_CLASS); if (field && field.length) { @@ -852,7 +852,7 @@ GitLabDropdown = (function() { if (href && href !== '#') { gl.utils.visitUrl(href); } else { - $el.first().trigger('click'); + $el.trigger('click'); } } }; |