mirror of
https://github.com/nasa/openmct.git
synced 2025-05-21 17:57:39 +00:00
[Time Conductor] Submit immediately on picker changes
This commit is contained in:
parent
1ef09ffbdd
commit
16efd85dfc
@ -12,8 +12,8 @@
|
|||||||
<mct-popup ng-if="picker.active">
|
<mct-popup ng-if="picker.active">
|
||||||
<div mct-click-elsewhere="picker.active = false">
|
<div mct-click-elsewhere="picker.active = false">
|
||||||
<mct-control key="'datetime-picker'"
|
<mct-control key="'datetime-picker'"
|
||||||
ng-model="ngModel"
|
ng-model="pickerModel"
|
||||||
field="field"
|
field="'value'"
|
||||||
options="{ hours: true }">
|
options="{ hours: true }">
|
||||||
</mct-control>
|
</mct-control>
|
||||||
</div>
|
</div>
|
||||||
|
@ -55,6 +55,7 @@ define(
|
|||||||
$scope.textInvalid = false;
|
$scope.textInvalid = false;
|
||||||
$scope.lastValidValue = $scope.textValue;
|
$scope.lastValidValue = $scope.textValue;
|
||||||
}
|
}
|
||||||
|
$scope.pickerModel = { value: value };
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateFromView(textValue) {
|
function updateFromView(textValue) {
|
||||||
@ -66,6 +67,14 @@ define(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateFromPicker(value) {
|
||||||
|
$scope.ngModel[$scope.field] = value;
|
||||||
|
updateFromModel(value);
|
||||||
|
if ($scope.structure && $scope.structure.submit) {
|
||||||
|
$scope.structure.submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function setFormat(format) {
|
function setFormat(format) {
|
||||||
formatter = formatService.getFormat(format || defaultFormat);
|
formatter = formatService.getFormat(format || defaultFormat);
|
||||||
updateFromModel($scope.ngModel[$scope.field]);
|
updateFromModel($scope.ngModel[$scope.field]);
|
||||||
@ -82,6 +91,7 @@ define(
|
|||||||
|
|
||||||
$scope.$watch('structure.format', setFormat);
|
$scope.$watch('structure.format', setFormat);
|
||||||
$scope.$watch('ngModel[field]', updateFromModel);
|
$scope.$watch('ngModel[field]', updateFromModel);
|
||||||
|
$scope.$watch('pickerModel.value', updateFromPicker);
|
||||||
$scope.$watch('textValue', updateFromView);
|
$scope.$watch('textValue', updateFromView);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user