From ecdc730de7b93c04d7673267a10da29c87b59e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sat, 23 Jan 2016 15:40:30 -0500 Subject: [PATCH] poc(): new panel system --- public/app/features/panel/panel_ctrl.ts | 26 ++++++++++++------- public/app/features/panel/partials/panel.html | 2 +- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index 19c1ed2bc8c..cc020c23423 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/public/app/features/panel/panel_ctrl.ts @@ -3,19 +3,13 @@ import PanelMeta from './panel_meta2'; export class PanelCtrl { - panelMeta: any; + meta: any; panel: any; row: any; dashboard: any; 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}); } @@ -23,11 +17,23 @@ export class PanelCtrl { this.scope.$root.appEvent(evtName, evt); } - editPanel() { + changeView(fullscreen, edit) { 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); + } } diff --git a/public/app/features/panel/partials/panel.html b/public/app/features/panel/partials/panel.html index f3eb19df424..3b325366826 100644 --- a/public/app/features/panel/partials/panel.html +++ b/public/app/features/panel/partials/panel.html @@ -32,7 +32,7 @@ -