dashboard: fix opening links in new tab (#10465)

This commit is contained in:
Alexander Zobnin 2018-01-09 15:59:11 +03:00 committed by Torkel Ödegaard
parent 51cd3a0d0c
commit 04b9752932

View File

@ -30,7 +30,9 @@ function dashLink($compile, linkSrv) {
if (link.asDropdown) { if (link.asDropdown) {
template += template +=
'<ul class="dropdown-menu" role="menu">' + '<ul class="dropdown-menu" role="menu">' +
'<li ng-repeat="dash in link.searchHits"><a href="{{dash.url}}">{{dash.title}}</a></li>' + '<li ng-repeat="dash in link.searchHits">' +
'<a href="{{dash.url}}" target="{{dash.target}}">{{dash.title}}</a>' +
'</li>' +
'</ul>'; '</ul>';
} }
@ -84,6 +86,7 @@ export class DashLinksContainerCtrl {
tags: linkDef.tags, tags: linkDef.tags,
keepTime: linkDef.keepTime, keepTime: linkDef.keepTime,
includeVars: linkDef.includeVars, includeVars: linkDef.includeVars,
target: linkDef.targetBlank ? '_blank' : '_self',
icon: 'fa fa-bars', icon: 'fa fa-bars',
asDropdown: true, asDropdown: true,
}, },
@ -128,6 +131,7 @@ export class DashLinksContainerCtrl {
memo.push({ memo.push({
title: dash.title, title: dash.title,
url: 'dashboard/' + dash.uri, url: 'dashboard/' + dash.uri,
target: link.target,
icon: 'fa fa-th-large', icon: 'fa fa-th-large',
keepTime: link.keepTime, keepTime: link.keepTime,
includeVars: link.includeVars, includeVars: link.includeVars,