mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fixed so that we close angular TimePicker when user clicks outside the dropdown
This commit is contained in:
@@ -280,6 +280,24 @@ export function grafanaAppDirective(playlistSrv, contextSrv, $timeout, $rootScop
|
|||||||
if (popover.length > 0 && target.parents('.graph-legend').length === 0) {
|
if (popover.length > 0 && target.parents('.graph-legend').length === 0) {
|
||||||
popover.hide();
|
popover.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// hide time picker
|
||||||
|
const timePickerDropDownIsOpen = elem.find('.gf-timepicker-dropdown').length > 0;
|
||||||
|
const targetIsInTimePickerDropDown = target.parents('.gf-timepicker-dropdown').length > 0;
|
||||||
|
const targetIsInTimePickerNav = target.parents('.gf-timepicker-nav').length > 0;
|
||||||
|
const targetIsDatePickerRowBtn = target.parents('td[id^="datepicker-"]').length > 0;
|
||||||
|
const targetIsDatePickerHeaderBtn = target.parents('button[id^="datepicker-"]').length > 0;
|
||||||
|
if (
|
||||||
|
timePickerDropDownIsOpen &&
|
||||||
|
!targetIsInTimePickerNav &&
|
||||||
|
!targetIsInTimePickerDropDown &&
|
||||||
|
!targetIsDatePickerRowBtn &&
|
||||||
|
!targetIsDatePickerHeaderBtn
|
||||||
|
) {
|
||||||
|
scope.$apply(() => {
|
||||||
|
scope.appEvent('closeTimepicker');
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user