wip: major change for refresh and render events flow

This commit is contained in:
Torkel Ödegaard
2018-08-25 08:49:39 -07:00
parent 4424bdd1b1
commit 6ba8f6c5ab
7 changed files with 66 additions and 23 deletions

View File

@@ -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) {

View File

@@ -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;