Move toolbar default variable above the toolbar setting funciton

This commit is contained in:
Marliana Lara 2019-03-06 10:48:14 -05:00
parent 661a54d356
commit 67753b790c
No known key found for this signature in database
GPG Key ID: 38C73B40DFA809EE

View File

@ -45,6 +45,11 @@ function ListJobsController (
setToolbarSort();
}, true);
const toolbarSortDefault = {
label: `${strings.get('sort.FINISH_TIME')}`,
value: '-finished'
};
function setToolbarSort () {
const orderByValue = _.get($state.params, 'job_search.order_by');
const sortValue = _.find(vm.toolbarSortOptions, (option) => option.value === orderByValue);
@ -55,11 +60,6 @@ function ListJobsController (
}
}
const toolbarSortDefault = {
label: `${strings.get('sort.FINISH_TIME')}`,
value: '-finished'
};
vm.toolbarSortOptions = [
{ label: `${strings.get('sort.NAME_ASCENDING')}`, value: 'name' },
{ label: `${strings.get('sort.NAME_DESCENDING')}`, value: '-name' },