Merge pull request #1807 from crgrieve/U4-9648

U4-9648 Remove the relevant query rather than the first one in list.
This commit is contained in:
Mads Rasmussen
2017-03-21 19:59:57 +01:00
committed by GitHub
2 changed files with 9 additions and 4 deletions

View File

@@ -122,9 +122,14 @@
query.filters.push({});
}
function trashFilter(query) {
query.filters.splice(query, 1);
function trashFilter(query, filter) {
for (var i = 0; i < query.filters.length; i++)
{
if (query.filters[i] == filter)
{
query.filters.splice(i, 1);
}
}
//if we remove the last one, add a new one to generate ui for it.
if (query.filters.length == 0) {
query.filters.push({});

View File

@@ -91,7 +91,7 @@
<i class="icon-add"></i>
</a>
<a href ng-click="vm.trashFilter(vm.query)">
<a href ng-click="vm.trashFilter(vm.query, filter)">
<i class="icon-trash"></i>
</a>