UI: minor fixes.

This commit is contained in:
Igor Kulikov 2017-02-14 14:49:06 +02:00
parent 9205f5383b
commit 7cee3bbaee
3 changed files with 9 additions and 5 deletions

View File

@ -38,9 +38,9 @@ function DatakeyConfigDialogController($scope, $mdDialog, deviceService, dataKey
};
vm.fetchDeviceKeys = function (deviceAliasId, query, type) {
var deviceId = vm.deviceAliases[deviceAliasId];
if (deviceId) {
return deviceService.getDeviceKeys(deviceId, query, type);
var alias = vm.deviceAliases[deviceAliasId];
if (alias) {
return deviceService.getDeviceKeys(alias.deviceId, query, type);
} else {
return [];
}

View File

@ -112,6 +112,7 @@ export default function AttributeTableDirective($compile, $templateCache, $rootS
if (!update) {
scope.selectedAttributes = [];
}
scope.$digest();
}
scope.getDeviceAttributes = function(forceUpdate) {

View File

@ -314,8 +314,11 @@ export default class TbDigitalGauge {
gParams.maxY = gParams.barTop;
this.gauge.txtMin.attr({"text-anchor": "start", "x": gParams.minX, "y": gParams.minY });
this.gauge.txtMax.attr({"text-anchor": "start", "x": gParams.maxX, "y": gParams.maxY });
maxW = Math.max(this.gauge.txtMin.node.getComputedTextLength(), this.gauge.txtMax.node.getComputedTextLength());
gParams.prefWidth = gParams.strokeWidth + (maxW + this.localSettings.minMaxFont.size ) * 2;
gParams.prefWidth = gParams.strokeWidth;
if (!this.localSettings.hideMinMax) {
maxW = Math.max(this.gauge.txtMin.node.getComputedTextLength(), this.gauge.txtMax.node.getComputedTextLength());
gParams.prefWidth += (maxW + this.localSettings.minMaxFont.size ) * 2;
}
gParams.viewport.x = (gParams.canvasW - gParams.prefWidth)/2;
gParams.viewport.width = gParams.prefWidth;
}