fixing order of filters
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@45520 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
9059f2942e
commit
1914c22625
|
@ -25,7 +25,7 @@ import {ModalLoading} from '../../utils/modal/loading.component';
|
|||
</span>
|
||||
<span *ngFor="let filter of filters " >
|
||||
<span *ngIf = "filter.countSelectedValues > 0"> {{filter.title}}:
|
||||
<span *ngFor="let value of filter.values.slice(0,filter.countSelectedValues); let i = index; let end = last; " >{{value.name}}<a (click) = "removeFilter(value, filter) "><span class=" e clickable" aria-hidden="true">[<i class="uk-icon-remove"></i>]</span></a>
|
||||
<span *ngFor="let value of getSelectedValues(filter); let i = index; let end = last; " >{{value.name}}<a (click) = "removeFilter(value, filter) "><span class=" e clickable" aria-hidden="true">[<i class="uk-icon-remove"></i>]</span></a>
|
||||
<span *ngIf="!end">, </span>
|
||||
</span>
|
||||
</span>
|
||||
|
@ -480,5 +480,16 @@ export class SearchPageComponent {
|
|||
this.loading.close();
|
||||
}
|
||||
}
|
||||
getSelectedValues(filter):any{
|
||||
var selected = [];
|
||||
if(filter.countSelectedValues >0){
|
||||
for (var i=0; i < filter.values.length; i++){
|
||||
if(filter.values[i].selected){
|
||||
selected.push(filter.values[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return selected;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue