Fix datakey function (#1992)

This commit is contained in:
Vladyslav 2019-09-10 15:43:11 +03:00 committed by Igor Kulikov
parent bc3c06e51d
commit 9538f65d53

View File

@ -183,9 +183,9 @@ function DatasourceFunc($compile, $templateCache, $mdDialog, $window, $document,
w.triggerHandler('resize');
}
}).then(function (newDataKey) {
if ((newDataKey.type === types.dataKeyType.timeseries) || (newDataKey.type === types.dataKeyType.attribute)) {
let index = scope.dataKeys.indexOf(dataKey);
scope.dataKeys[index] = newDataKey;
if (newDataKey.type === types.dataKeyType.function) {
let index = scope.funcDataKeys.indexOf(dataKey);
scope.funcDataKeys[index] = newDataKey;
} else if (newDataKey.type === types.dataKeyType.alarm) {
let index = scope.alarmDataKeys.indexOf(dataKey);
scope.alarmDataKeys[index] = newDataKey;