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:
parent
310ee5674f
commit
e2ffaef88a
@ -280,6 +280,24 @@ export function grafanaAppDirective(playlistSrv, contextSrv, $timeout, $rootScop
|
||||
if (popover.length > 0 && target.parents('.graph-legend').length === 0) {
|
||||
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');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user