mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 10:30:03 -03:30
[system_tracking] Update right date when left is changed to something greater
This commit is contained in:
parent
0dabe450ac
commit
c8744a8e8f
@ -13,7 +13,8 @@ export default
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
date: '=',
|
||||
minDate: '='
|
||||
minDate: '=',
|
||||
autoUpdate: '=?'
|
||||
},
|
||||
templateUrl: '/static/js/system-tracking/date-picker/date-picker.partial.html',
|
||||
link: function(scope, element, attrs) {
|
||||
@ -21,10 +22,16 @@ export default
|
||||
// We need to make sure this _never_ recurses, which sometimes happens
|
||||
// with two-way binding.
|
||||
var mustUpdateValue = true;
|
||||
scope.autoUpdate = scope.autoUpdate === false ? false : true;
|
||||
|
||||
scope.$watch('minDate', function(newValue) {
|
||||
if (newValue) {
|
||||
$('.date', element).systemTrackingDP('setStartDate', newValue.toString());
|
||||
|
||||
if (scope.autoUpdate && scope.date.isBefore(newValue)) {
|
||||
scope.date = newValue;
|
||||
}
|
||||
|
||||
$('.date', element).systemTrackingDP('setStartDate', newValue.toDate());
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user