This commit is contained in:
Mitsuhiro Tanda 2016-06-26 22:15:57 +09:00
parent 16dc095329
commit 8af3bb739c

View File

@ -359,10 +359,12 @@ function (angular, _, kbn) {
}
options = _.uniq(options, 'value');
var sortType = Math.ceil(variable.sort / 2);
if (sortType === 0) {
if (variable.sort === 0) {
return options;
} else {
}
var sortType = Math.ceil(variable.sort / 2);
var reverseSort = (variable.sort % 2 === 0);
if (sortType === 1) {
options = _.sortBy(options, 'text');
} else if (sortType === 2) {
@ -375,13 +377,11 @@ function (angular, _, kbn) {
}
});
}
if (variable.sort % 2 === 0) {
if (reverseSort) {
options = options.reverse();
}
return options;
}
};
this.addAllOption = function(variable) {