Commit bde81ef6 authored by Kushal Pandya's avatar Kushal Pandya

Remove unnecessary element check

parent 76bd18f6
...@@ -48,25 +48,23 @@ export default class Todos { ...@@ -48,25 +48,23 @@ export default class Todos {
} }
initFilterDropdown($dropdown, fieldName, searchFields) { initFilterDropdown($dropdown, fieldName, searchFields) {
if ($dropdown.length) { $dropdown.glDropdown({
$dropdown.glDropdown({ fieldName,
fieldName, selectable: true,
selectable: true, filterable: searchFields ? true : false,
filterable: searchFields ? true : false, search: { fields: searchFields },
search: { fields: searchFields }, data: $dropdown.data('data'),
data: $dropdown.data('data'), clicked: () => {
clicked: () => { const $formEl = $dropdown.closest('form.filter-form');
const $formEl = $dropdown.closest('form.filter-form'); const mutexDropdowns = {
const mutexDropdowns = { group_id: 'project_id',
group_id: 'project_id', project_id: 'group_id',
project_id: 'group_id', };
};
$formEl.find(`input[name="${mutexDropdowns[fieldName]}"]`).remove();
$formEl.find(`input[name="${mutexDropdowns[fieldName]}"]`).remove(); $formEl.submit();
$formEl.submit(); },
}, });
});
}
} }
updateRowStateClicked(e) { updateRowStateClicked(e) {
......
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