Kaynağa Gözat

feat(panel): added new panel event panel-initialized

Torkel Ödegaard 9 yıl önce
ebeveyn
işleme
dfe36fb702

+ 1 - 1
public/app/features/dashboard/viewStateSrv.js

@@ -36,7 +36,7 @@ function (angular, _, $) {
         self.update(payload);
       });
 
-      $scope.onAppEvent('panel-instantiated', function(evt, payload) {
+      $scope.onAppEvent('panel-initialized', function(evt, payload) {
         self.registerPanel(payload.scope);
       });
 

+ 4 - 1
public/app/features/panel/panel_ctrl.ts

@@ -50,8 +50,11 @@ export class PanelCtrl {
   }
 
   init() {
-    this.publishAppEvent('panel-instantiated', {scope: this.$scope});
     this.calculatePanelHeight();
+
+    this.publishAppEvent('panel-initialized', {scope: this.$scope});
+    this.events.emit('panel-initialized');
+
     this.refresh();
   }