Merge pull request #1106 from Terny22/widget-basic-settings
fixed units and decimals settings in some widgets
This commit is contained in:
commit
23a596bbd4
File diff suppressed because one or more lines are too long
@ -371,7 +371,9 @@ function EntitiesTableWidgetController($element, $scope, $filter, $mdMedia, $mdP
|
||||
content = strContent;
|
||||
}
|
||||
} else {
|
||||
content = defaultContent(key, value);
|
||||
var decimals = (contentInfo.decimals || contentInfo.decimals === 0) ? contentInfo.decimals : vm.widgetConfig.decimals;
|
||||
var units = contentInfo.units || vm.widgetConfig.units;
|
||||
content = vm.ctx.utils.formatValue(value, decimals, units, true);
|
||||
}
|
||||
return content;
|
||||
} else {
|
||||
@ -379,14 +381,6 @@ function EntitiesTableWidgetController($element, $scope, $filter, $mdMedia, $mdP
|
||||
}
|
||||
}
|
||||
|
||||
function defaultContent(key, value) {
|
||||
if (angular.isDefined(value)) {
|
||||
return value;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function defaultStyle(/*key, value*/) {
|
||||
return {};
|
||||
}
|
||||
@ -542,7 +536,9 @@ function EntitiesTableWidgetController($element, $scope, $filter, $mdMedia, $mdP
|
||||
|
||||
vm.contentsInfo[dataKey.label] = {
|
||||
useCellContentFunction: useCellContentFunction,
|
||||
cellContentFunction: cellContentFunction
|
||||
cellContentFunction: cellContentFunction,
|
||||
units: dataKey.units,
|
||||
decimals: dataKey.decimals
|
||||
};
|
||||
|
||||
var columnWidth = angular.isDefined(keySettings.columnWidth) ? keySettings.columnWidth : '0px';
|
||||
|
||||
@ -217,7 +217,9 @@ function TimeseriesTableWidgetController($element, $scope, $filter, $timeout) {
|
||||
content = strContent;
|
||||
}
|
||||
} else {
|
||||
content = vm.ctx.utils.formatValue(value, contentInfo.decimals, contentInfo.units);
|
||||
var decimals = (contentInfo.decimals || contentInfo.decimals === 0) ? contentInfo.decimals : vm.widgetConfig.decimals;
|
||||
var units = contentInfo.units || vm.widgetConfig.units;
|
||||
content = vm.ctx.utils.formatValue(value, decimals, units, true);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user