Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
92689274
Unverified
Commit
92689274
authored
Jul 06, 2018
by
Marcus Efraimsson
Committed by
GitHub
Jul 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12518 from grafana/12506_dash_links
Fix links not updating after changing variables
parents
50a522d4
5e4d6958
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
public/app/features/dashlinks/module.ts
+9
-8
No files found.
public/app/features/dashlinks/module.ts
View file @
92689274
...
@@ -41,20 +41,20 @@ function dashLink($compile, $sanitize, linkSrv) {
...
@@ -41,20 +41,20 @@ function dashLink($compile, $sanitize, linkSrv) {
elem
.
html
(
template
);
elem
.
html
(
template
);
$compile
(
elem
.
contents
())(
scope
);
$compile
(
elem
.
contents
())(
scope
);
var
anchor
=
elem
.
find
(
'a'
);
var
icon
=
elem
.
find
(
'i'
);
var
span
=
elem
.
find
(
'span'
);
function
update
()
{
function
update
()
{
var
linkInfo
=
linkSrv
.
getAnchorInfo
(
link
);
var
linkInfo
=
linkSrv
.
getAnchorInfo
(
link
);
const
anchor
=
elem
.
find
(
'a'
);
const
span
=
elem
.
find
(
'span'
);
span
.
text
(
linkInfo
.
title
);
span
.
text
(
linkInfo
.
title
);
if
(
!
link
.
asDropdown
)
{
if
(
!
link
.
asDropdown
)
{
anchor
.
attr
(
'href'
,
linkInfo
.
href
);
anchor
.
attr
(
'href'
,
linkInfo
.
href
);
sanitizeAnchor
();
sanitizeAnchor
();
}
}
elem
.
find
(
'a'
)
.
attr
(
'data-placement'
,
'bottom'
);
anchor
.
attr
(
'data-placement'
,
'bottom'
);
// tooltip
// tooltip
elem
.
find
(
'a'
)
.
tooltip
({
anchor
.
tooltip
({
title
:
$sanitize
(
scope
.
link
.
tooltip
),
title
:
$sanitize
(
scope
.
link
.
tooltip
),
html
:
true
,
html
:
true
,
container
:
'body'
,
container
:
'body'
,
...
@@ -62,12 +62,13 @@ function dashLink($compile, $sanitize, linkSrv) {
...
@@ -62,12 +62,13 @@ function dashLink($compile, $sanitize, linkSrv) {
}
}
function
sanitizeAnchor
()
{
function
sanitizeAnchor
()
{
const
anchor
=
elem
.
find
(
'a'
);
const
anchorSanitized
=
$sanitize
(
anchor
.
parent
().
html
());
const
anchorSanitized
=
$sanitize
(
anchor
.
parent
().
html
());
anchor
.
parent
().
html
(
anchorSanitized
);
anchor
.
parent
().
html
(
anchorSanitized
);
}
}
icon
.
attr
(
'class'
,
'fa fa-fw '
+
scope
.
link
.
icon
);
elem
.
find
(
'i'
)
.
attr
(
'class'
,
'fa fa-fw '
+
scope
.
link
.
icon
);
anchor
.
attr
(
'target'
,
scope
.
link
.
target
);
elem
.
find
(
'a'
)
.
attr
(
'target'
,
scope
.
link
.
target
);
// fix for menus on the far right
// fix for menus on the far right
if
(
link
.
asDropdown
&&
scope
.
$last
)
{
if
(
link
.
asDropdown
&&
scope
.
$last
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment