Skip to content

Commit

Permalink
Merge pull request grafana#14646 from grafana/fix-dashboard-links
Browse files Browse the repository at this point in the history
Fixed dashboard links not updating after variable or time range change
  • Loading branch information
torkelo authored Dec 23, 2018
2 parents 0fd403a + 002f57a commit 17de1f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion public/app/features/dashboard/dashlinks/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function dashLinksContainer() {
return {
scope: {
links: '=',
dashboard: '=',
},
restrict: 'E',
controller: 'DashLinksContainerCtrl',
Expand All @@ -20,6 +21,8 @@ function dashLink($compile, $sanitize, linkSrv) {
restrict: 'E',
link: (scope, elem) => {
const link = scope.link;
const dashboard = scope.dashboard;

let template =
'<div class="gf-form">' +
'<a class="pointer gf-form-label" data-placement="bottom"' +
Expand Down Expand Up @@ -76,7 +79,7 @@ function dashLink($compile, $sanitize, linkSrv) {
}

update();
scope.$on('refresh', update);
dashboard.events.on('refresh', update, scope);
},
};
}
Expand Down
2 changes: 1 addition & 1 deletion public/app/features/dashboard/submenu/submenu.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</div>

<div ng-if="ctrl.dashboard.links.length > 0" >
<dash-links-container links="ctrl.dashboard.links" class="gf-form-inline"></dash-links-container>
<dash-links-container links="ctrl.dashboard.links" dashboard="ctrl.dashboard" class="gf-form-inline"></dash-links-container>
</div>

<div class="clearfix"></div>
Expand Down

0 comments on commit 17de1f2

Please sign in to comment.