|
|
@@ -165,22 +165,30 @@ export function grafanaAppDirective() {
|
|
|
|
|
|
// handle document clicks that should hide things
|
|
|
elem.click(function(evt) {
|
|
|
- if ($(evt.target).parents().length === 0) {
|
|
|
+ var target = $(evt.target);
|
|
|
+ if (target.parents().length === 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
// hide search
|
|
|
if (elem.find('.search-container').length > 0) {
|
|
|
- if ($(evt.target).parents('.search-container').length === 0) {
|
|
|
+ if (target.parents('.search-container').length === 0) {
|
|
|
scope.appEvent('hide-dash-search');
|
|
|
}
|
|
|
}
|
|
|
// hide sidemenu
|
|
|
if (!ignoreSideMenuHide && elem.find('.sidemenu').length > 0) {
|
|
|
- if ($(evt.target).parents('.sidemenu').length === 0) {
|
|
|
+ if (target.parents('.sidemenu').length === 0) {
|
|
|
scope.$apply(() => scope.contextSrv.toggleSideMenu());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ // hide popovers
|
|
|
+ var popover = elem.find('.popover');
|
|
|
+ console.log(target.parents('.graph-legend').length);
|
|
|
+ if (popover.length > 0 && target.parents('.graph-legend').length === 0) {
|
|
|
+ popover.hide();
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
};
|