1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

[system_tracking] Disable dates on right prior to dates on left

This commit is contained in:
Joe Fiorini 2015-06-17 16:55:38 -04:00
parent dbb8c649de
commit aec91bc13e
2 changed files with 9 additions and 2 deletions

View File

@ -12,7 +12,8 @@ export default
return {
restrict: 'E',
scope: {
date: '='
date: '=',
minDate: '='
},
templateUrl: '/static/js/system-tracking/date-picker/date-picker.partial.html',
link: function(scope, element, attrs) {
@ -21,6 +22,12 @@ export default
// with two-way binding.
var mustUpdateValue = true;
scope.$watch('minDate', function(newValue) {
if (newValue) {
$('.date', element).systemTrackingDP('setStartDate', newValue.toString());
}
});
scope.$watch('date', function(newValue) {
if (newValue) {
mustUpdateValue = false;

View File

@ -12,7 +12,7 @@
</div>
<div class="FactModulePickers-dateContainer FactModulePickers-dateContainer--right" ng-show="compareMode == 'single-host'">
<span class="FactModulePickers-label">{{ factModulePickersLabelRight }}</span>
<date-picker date="rightDate"></date-picker>
<date-picker date="rightDate" min-date="leftDate"></date-picker>
</div>
</div>