mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fixed value dropdown not updating when it's current value updates, fixes #15566
This commit is contained in:
@@ -240,7 +240,7 @@ export class ValueSelectDropdownCtrl {
|
||||
/** @ngInject */
|
||||
export function valueSelectDropdown($compile, $window, $timeout, $rootScope) {
|
||||
return {
|
||||
scope: { variable: '=', onUpdated: '&' },
|
||||
scope: { dashboard: '=', variable: '=', onUpdated: '&' },
|
||||
templateUrl: 'public/app/partials/valueSelectDropdown.html',
|
||||
controller: 'ValueSelectDropdownCtrl',
|
||||
controllerAs: 'vm',
|
||||
@@ -288,13 +288,13 @@ export function valueSelectDropdown($compile, $window, $timeout, $rootScope) {
|
||||
}
|
||||
});
|
||||
|
||||
const cleanUp = $rootScope.$on('template-variable-value-updated', () => {
|
||||
scope.vm.updateLinkText();
|
||||
});
|
||||
|
||||
scope.$on('$destroy', () => {
|
||||
cleanUp();
|
||||
});
|
||||
scope.vm.dashboard.on(
|
||||
'template-variable-value-updated',
|
||||
() => {
|
||||
scope.vm.updateLinkText();
|
||||
},
|
||||
scope
|
||||
);
|
||||
|
||||
scope.vm.init();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user