[Aggregations labels] Address epixa comments about redundant check and more isolated changes.

This commit is contained in:
Alvaro del Castillo 2016-01-21 22:30:11 +01:00
parent b9a4582bec
commit eeb3581014

View file

@ -259,14 +259,13 @@ define(function (require) {
};
AggConfig.prototype.makeLabel = function () {
var label = (_.get(this.vis, 'params.mode') === 'percentage') ? 'Percentage of ' : '';
label += this.type.makeLabel(this);
if (this.params.customLabel && this.params.customLabel !== '') {
label = this.params.customLabel;
if (this.params.customLabel) {
return this.params.customLabel;
}
return label;
if (!this.type) return '';
var pre = (_.get(this.vis, 'params.mode') === 'percentage') ? 'Percentage of ' : '';
return pre += this.type.makeLabel(this);
};
AggConfig.prototype.field = function () {