Commit 8460b48c by Johannes Schill

Always open panel links in new window if user asked for it #14333

parent 276f2567
...@@ -73,6 +73,7 @@ export class LinkSrv { ...@@ -73,6 +73,7 @@ export class LinkSrv {
getPanelLinkAnchorInfo(link, scopedVars) { getPanelLinkAnchorInfo(link, scopedVars) {
const info: any = {}; const info: any = {};
info.target = link.targetBlank ? '_blank' : '';
if (link.type === 'absolute') { if (link.type === 'absolute') {
info.target = link.targetBlank ? '_blank' : '_self'; info.target = link.targetBlank ? '_blank' : '_self';
info.href = this.templateSrv.replace(link.url || '', scopedVars); info.href = this.templateSrv.replace(link.url || '', scopedVars);
...@@ -80,11 +81,9 @@ export class LinkSrv { ...@@ -80,11 +81,9 @@ export class LinkSrv {
} else if (link.url) { } else if (link.url) {
info.href = link.url; info.href = link.url;
info.title = this.templateSrv.replace(link.title || '', scopedVars); info.title = this.templateSrv.replace(link.title || '', scopedVars);
info.target = link.targetBlank ? '_blank' : '';
} else if (link.dashUri) { } else if (link.dashUri) {
info.href = 'dashboard/' + link.dashUri + '?'; info.href = 'dashboard/' + link.dashUri + '?';
info.title = this.templateSrv.replace(link.title || '', scopedVars); info.title = this.templateSrv.replace(link.title || '', scopedVars);
info.target = link.targetBlank ? '_blank' : '';
} else { } else {
info.title = this.templateSrv.replace(link.title || '', scopedVars); info.title = this.templateSrv.replace(link.title || '', scopedVars);
const slug = kbn.slugifyForUrl(link.dashboard || ''); const slug = kbn.slugifyForUrl(link.dashboard || '');
......
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