mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
refactor
This commit is contained in:
parent
16dc095329
commit
8af3bb739c
@ -359,10 +359,12 @@ function (angular, _, kbn) {
|
|||||||
}
|
}
|
||||||
options = _.uniq(options, 'value');
|
options = _.uniq(options, 'value');
|
||||||
|
|
||||||
var sortType = Math.ceil(variable.sort / 2);
|
if (variable.sort === 0) {
|
||||||
if (sortType === 0) {
|
|
||||||
return options;
|
return options;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
var sortType = Math.ceil(variable.sort / 2);
|
||||||
|
var reverseSort = (variable.sort % 2 === 0);
|
||||||
if (sortType === 1) {
|
if (sortType === 1) {
|
||||||
options = _.sortBy(options, 'text');
|
options = _.sortBy(options, 'text');
|
||||||
} else if (sortType === 2) {
|
} else if (sortType === 2) {
|
||||||
@ -375,13 +377,11 @@ function (angular, _, kbn) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (reverseSort) {
|
||||||
if (variable.sort % 2 === 0) {
|
|
||||||
options = options.reverse();
|
options = options.reverse();
|
||||||
}
|
}
|
||||||
|
|
||||||
return options;
|
return options;
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.addAllOption = function(variable) {
|
this.addAllOption = function(variable) {
|
||||||
|
Loading…
Reference in New Issue
Block a user