Commit 76d03f69 authored by Clement Ho's avatar Clement Ho

[skip ci] refactor into options argument

parent 57de747c
...@@ -350,7 +350,12 @@ GitLabDropdown = (function() { ...@@ -350,7 +350,12 @@ GitLabDropdown = (function() {
selectedObj = selected ? selected[0] : null; selectedObj = selected ? selected[0] : null;
isMarking = selected ? selected[1] : null; isMarking = selected ? selected[1] : null;
if (this.options.clicked) { if (this.options.clicked) {
this.options.clicked.call(this, selectedObj, $el, e, isMarking); this.options.clicked.call(this, {
user: 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
......
...@@ -290,7 +290,9 @@ import eventHub from './sidebar/event_hub'; ...@@ -290,7 +290,9 @@ import eventHub from './sidebar/event_hub';
}, },
multiSelect: $dropdown.hasClass('js-multiselect'), multiSelect: $dropdown.hasClass('js-multiselect'),
vue: $dropdown.hasClass('js-issue-board-sidebar'), vue: $dropdown.hasClass('js-issue-board-sidebar'),
clicked: function(user, $el, e, isMarking) { clicked: function(options) {
const { user, $el, e, isMarking } = options;
if ($dropdown.hasClass('js-multiselect')) { if ($dropdown.hasClass('js-multiselect')) {
const isActive = $el.hasClass('is-active'); const isActive = $el.hasClass('is-active');
const previouslySelected = $dropdown.closest('.selectbox') const previouslySelected = $dropdown.closest('.selectbox')
......
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