Преглед изворни кода

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

Johannes Schill пре 7 година
родитељ
комит
8460b48c24
1 измењених фајлова са 1 додато и 2 уклоњено
  1. 1 2
      public/app/features/dashboard/panellinks/link_srv.ts

+ 1 - 2
public/app/features/dashboard/panellinks/link_srv.ts

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