Commit edcef7d0 by Torkel Ödegaard

fix(graph): fixed for graph series color selector popover, broken in recent…

fix(graph): fixed for graph series color selector popover, broken in recent 3.0-pre1 build, fixes #3774
parent 30c19d52
...@@ -165,22 +165,30 @@ export function grafanaAppDirective() { ...@@ -165,22 +165,30 @@ export function grafanaAppDirective() {
// handle document clicks that should hide things // handle document clicks that should hide things
elem.click(function(evt) { elem.click(function(evt) {
if ($(evt.target).parents().length === 0) { var target = $(evt.target);
if (target.parents().length === 0) {
return; return;
} }
// hide search // hide search
if (elem.find('.search-container').length > 0) { 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'); scope.appEvent('hide-dash-search');
} }
} }
// hide sidemenu // hide sidemenu
if (!ignoreSideMenuHide && elem.find('.sidemenu').length > 0) { 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()); 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();
}
}); });
} }
}; };
......
...@@ -45,7 +45,7 @@ function (angular, _, $) { ...@@ -45,7 +45,7 @@ function (angular, _, $) {
popoverScope.series = seriesInfo; popoverScope.series = seriesInfo;
popoverSrv.show({ popoverSrv.show({
element: el, element: el,
templateUrl: 'app/plugins/panels/graph/legend.popover.html', templateUrl: 'app/plugins/panel/graph/legend.popover.html',
scope: popoverScope scope: popoverScope
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment