From ffff13205a711b916746786c628524ba7215055c Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 25 Nov 2015 11:21:51 -0800 Subject: [PATCH] [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.) --- .../general/src/controllers/DateTimeFieldController.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/platform/commonUI/general/src/controllers/DateTimeFieldController.js b/platform/commonUI/general/src/controllers/DateTimeFieldController.js index 2084c32382..d401a8b3fc 100644 --- a/platform/commonUI/general/src/controllers/DateTimeFieldController.js +++ b/platform/commonUI/general/src/controllers/DateTimeFieldController.js @@ -68,10 +68,12 @@ define( } function updateFromPicker(value) { - $scope.ngModel[$scope.field] = value; - updateFromModel(value); - if ($scope.structure && $scope.structure.submit) { - $scope.structure.submit(); + if (value !== $scope.ngModel[$scope.field]) { + $scope.ngModel[$scope.field] = value; + updateFromModel(value); + if ($scope.structure && $scope.structure.submit) { + $scope.structure.submit(); + } } }