Commit ceb06269 authored by njrfhtd's avatar njrfhtd
Browse files

viewSchema checkUnique prevent duplicate event in watcher: compare old vs new speeds

parent 13b98da0
Showing with 5 additions and 3 deletions
+5 -3
......@@ -957,8 +957,10 @@ function ViewSchemaCtrl($scope, $http, $routeParams, $popover, $alert, $window,
}
vm.checkSpeedType = function(newValue, oldValue) {
if(vm.schema.speedTypes.output.length > 0) {
vm.checkSchemaUnique();
if(JSON.stringify(oldValue)!=JSON.stringify(newValue)) {
if(vm.schema.speedTypes.output.length > 0) {
vm.checkSchemaUnique();
}
}
}
......@@ -1008,7 +1010,7 @@ function ViewSchemaCtrl($scope, $http, $routeParams, $popover, $alert, $window,
$scope.$watch('vm.schema.depBranch', vm.checkDepBranch);
$scope.$watch('vm.schema.arrBranch', vm.checkArrBranch);
//+++$scope.$watch('vm.schema.speedType', vm.checkSpeedType);
$scope.$watch('vm.schema.speedTypes.output', vm.checkSpeedType);
$scope.$watchCollection('vm.schema.speedTypes.output', vm.checkSpeedType);
//
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment