Commit 323e8c4e authored by Alfredo Sumaran's avatar Alfredo Sumaran

Merge branch 'gl-dropdown-fix' into 'master'

Backport changes from EE to gl_dropdown.js

REF: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/977

See merge request !8165
parents 5048baaa d80b2677
...@@ -343,16 +343,18 @@ ...@@ -343,16 +343,18 @@
selector = ".dropdown-page-one .dropdown-content a"; selector = ".dropdown-page-one .dropdown-content a";
} }
this.dropdown.on("click", selector, function(e) { this.dropdown.on("click", selector, function(e) {
var $el, selected; var $el, selected, selectedObj, isMarking;
$el = $(this); $el = $(this);
selected = self.rowClicked($el); selected = self.rowClicked($el);
selectedObj = selected ? selected[0] : null;
isMarking = selected ? selected[1] : null;
if (self.options.clicked) { if (self.options.clicked) {
self.options.clicked(selected[0], $el, e, selected[1]); self.options.clicked(selectedObj, $el, e, isMarking);
} }
// Update label right after all modifications in dropdown has been done // Update label right after all modifications in dropdown has been done
if (self.options.toggleLabel) { if (self.options.toggleLabel) {
self.updateLabel(selected[0], $el, self); self.updateLabel(selectedObj, $el, self);
} }
$el.trigger('blur'); $el.trigger('blur');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment