mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
wip: major change for refresh and render events flow
This commit is contained in:
@@ -47,7 +47,6 @@ export class PanelCtrl {
|
||||
this.pluginName = plugin.name;
|
||||
}
|
||||
|
||||
$scope.$on('refresh', () => this.refresh());
|
||||
$scope.$on('component-did-mount', () => this.panelDidMount());
|
||||
|
||||
$scope.$on('$destroy', () => {
|
||||
@@ -57,8 +56,7 @@ export class PanelCtrl {
|
||||
}
|
||||
|
||||
init() {
|
||||
this.events.emit('panel-initialized');
|
||||
this.publishAppEvent('panel-initialized', { scope: this.$scope });
|
||||
this.dashboard.panelInitialized(this.panel);
|
||||
}
|
||||
|
||||
panelDidMount() {
|
||||
@@ -70,7 +68,7 @@ export class PanelCtrl {
|
||||
}
|
||||
|
||||
refresh() {
|
||||
this.events.emit('refresh', null);
|
||||
this.panel.refresh();
|
||||
}
|
||||
|
||||
publishAppEvent(evtName, evt) {
|
||||
|
||||
@@ -151,6 +151,7 @@ module.directive('grafanaPanel', function($rootScope, $document, $timeout) {
|
||||
panelHeightUpdated();
|
||||
|
||||
ctrl.events.on('render', () => {
|
||||
console.log('panel_directive: render', ctrl.panel.id);
|
||||
if (transparentLastState !== ctrl.panel.transparent) {
|
||||
panelContainer.toggleClass('panel-transparent', ctrl.panel.transparent === true);
|
||||
transparentLastState = ctrl.panel.transparent;
|
||||
|
||||
Reference in New Issue
Block a user