[Time Conductor] Check for value changes

...on watches triggered from the picker. Only want to
trigger a submit when this actually constitutes a change from
the datetime field's underlying model (to avoid triggering
form submission when datetime picker is initialized.)
This commit is contained in:
Victor Woeltjen 2015-11-25 11:21:51 -08:00
parent 16efd85dfc
commit ffff13205a

View File

@ -68,10 +68,12 @@ define(
} }
function updateFromPicker(value) { function updateFromPicker(value) {
$scope.ngModel[$scope.field] = value; if (value !== $scope.ngModel[$scope.field]) {
updateFromModel(value); $scope.ngModel[$scope.field] = value;
if ($scope.structure && $scope.structure.submit) { updateFromModel(value);
$scope.structure.submit(); if ($scope.structure && $scope.structure.submit) {
$scope.structure.submit();
}
} }
} }