Torkel Ödegaard 10 лет назад
Родитель
Сommit
ecdc730de7
2 измененных файлов с 17 добавлено и 11 удалено
  1. 16 10
      public/app/features/panel/panel_ctrl.ts
  2. 1 1
      public/app/features/panel/partials/panel.html

+ 16 - 10
public/app/features/panel/panel_ctrl.ts

@@ -3,19 +3,13 @@
 import PanelMeta from './panel_meta2';
 import PanelMeta from './panel_meta2';
 
 
 export class PanelCtrl {
 export class PanelCtrl {
-  panelMeta: any;
+  meta: any;
   panel: any;
   panel: any;
   row: any;
   row: any;
   dashboard: any;
   dashboard: any;
 
 
   constructor(private scope) {
   constructor(private scope) {
-    this.panelMeta = new PanelMeta({
-      panelName: 'Table',
-      editIcon:  "fa fa-table",
-      fullscreen: true,
-      metricsEditor: true,
-    });
-
+    this.meta = new PanelMeta(this.panel);
     this.publishAppEvent('panel-instantiated', {scope: scope});
     this.publishAppEvent('panel-instantiated', {scope: scope});
   }
   }
 
 
@@ -23,11 +17,23 @@ export class PanelCtrl {
     this.scope.$root.appEvent(evtName, evt);
     this.scope.$root.appEvent(evtName, evt);
   }
   }
 
 
-  editPanel() {
+  changeView(fullscreen, edit) {
     this.publishAppEvent('panel-change-view', {
     this.publishAppEvent('panel-change-view', {
-      fullscreen: true, edit: true, panelId: this.panel.id
+      fullscreen: fullscreen, edit: edit, panelId: this.panel.id
     });
     });
   }
   }
+
+  viewPanel() {
+    this.changeView(true, false);
+  }
+
+  editPanel() {
+    this.changeView(true, true);
+  }
+
+  exitFullscreen() {
+    this.changeView(false, false);
+  }
 }
 }
 
 
 
 

+ 1 - 1
public/app/features/panel/partials/panel.html

@@ -32,7 +32,7 @@
 				</div>
 				</div>
 			</div>
 			</div>
 
 
-			<button class="gf-box-header-close-btn" ng-click="exitFullscreen();">
+			<button class="gf-box-header-close-btn" ng-click="ctrl.exitFullscreen();">
 				Back to dashboard
 				Back to dashboard
 			</button>
 			</button>
 		</div>
 		</div>