diff options
author | kushalpandya <kushal@gitlab.com> | 2017-10-13 19:33:18 +0530 |
---|---|---|
committer | kushalpandya <kushal@gitlab.com> | 2017-10-13 19:33:18 +0530 |
commit | 893402d477436d36b48c2fd0244576a0d16e9425 (patch) | |
tree | 97bdb18aafc267d04a1a71b246160a3cda1d35e7 | |
parent | 4d79159973d7b51230ceb9efd33bb1cbb191621b (diff) | |
download | gitlab-ce-bvl-group-trees.tar.gz |
Preserve `archived` param only when sort order is changedbvl-group-trees
-rw-r--r-- | app/assets/javascripts/groups/groups_filterable_list.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/groups/groups_filterable_list.js b/app/assets/javascripts/groups/groups_filterable_list.js index 396e57c5802..2db233b09da 100644 --- a/app/assets/javascripts/groups/groups_filterable_list.js +++ b/app/assets/javascripts/groups/groups_filterable_list.js @@ -64,11 +64,11 @@ export default class GroupFilterableList extends FilterableList { // Get type of option selected from dropdown const currentTargetClassList = e.currentTarget.parentElement.classList; const isOptionFilterBySort = currentTargetClassList.contains('js-filter-sort-order'); + const isOptionFilterByArchivedProjects = currentTargetClassList.contains('js-filter-archived-projects'); // Get option query param, also preserve currently applied query param - const isOptionFilterByArchivedProjects = currentTargetClassList.contains('js-filter-archived-projects'); - const sortParam = getParameterByName('sort', e.currentTarget.href) || getParameterByName('sort', window.location.href); - const archivedParam = getParameterByName('archived', e.currentTarget.href) || getParameterByName('archived', window.location.href); + const sortParam = getParameterByName('sort', isOptionFilterBySort ? e.currentTarget.href : window.location.href); + const archivedParam = getParameterByName('archived', isOptionFilterByArchivedProjects ? e.currentTarget.href : window.location.href); if (sortParam) { queryData.sort = sortParam; |