mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(singlestat): fixed issue with singlestat and drilldown link introduced in recent commit, fixes #3777
This commit is contained in:
parent
6fc972ab1e
commit
1d4803cff0
@ -23,6 +23,7 @@ function (SingleStatCtrl, _, $) {
|
||||
elem = inner;
|
||||
$panelContainer = elem.parents('.panel-container');
|
||||
firstRender = false;
|
||||
hookupDrilldownLinkTooltip();
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,6 +187,7 @@ function (SingleStatCtrl, _, $) {
|
||||
}
|
||||
}
|
||||
|
||||
function hookupDrilldownLinkTooltip() {
|
||||
// drilldown link tooltip
|
||||
var drilldownTooltip = $('<div id="tooltip" class="">hello</div>"');
|
||||
|
||||
@ -194,8 +196,10 @@ function (SingleStatCtrl, _, $) {
|
||||
drilldownTooltip.detach();
|
||||
});
|
||||
|
||||
elem.click(function() {
|
||||
elem.click(function(evt) {
|
||||
if (!linkInfo) { return; }
|
||||
// ignore title clicks in title
|
||||
if ($(evt).parents('.panel-header').length > 0) { return; }
|
||||
|
||||
if (linkInfo.target === '_blank') {
|
||||
var redirectWindow = window.open(linkInfo.href, '_blank');
|
||||
@ -218,10 +222,10 @@ function (SingleStatCtrl, _, $) {
|
||||
if (!linkInfo) { return;}
|
||||
|
||||
drilldownTooltip.text('click to go to: ' + linkInfo.title);
|
||||
|
||||
drilldownTooltip.place_tt(e.pageX+20, e.pageY-15);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user