diff --git a/public/app/features/dashboard/panel_model.ts b/public/app/features/dashboard/panel_model.ts index 2aa7880606d..fa80b1d8919 100644 --- a/public/app/features/dashboard/panel_model.ts +++ b/public/app/features/dashboard/panel_model.ts @@ -29,6 +29,7 @@ export class PanelModel { minSpan?: number; collapsed?: boolean; panels?: any; + soloMode?: boolean; // non persisted fullscreen: boolean; diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index b6cae5c7ece..91c1b06cbf4 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/public/app/features/panel/panel_ctrl.ts @@ -172,6 +172,10 @@ export class PanelCtrl { this.containerHeight = this.panel.gridPos.h * GRID_CELL_HEIGHT + ((this.panel.gridPos.h-1) * GRID_CELL_VMARGIN); } + if (this.panel.soloMode) { + this.containerHeight = $(window).height(); + } + this.height = this.containerHeight - (PANEL_BORDER + TITLE_HEIGHT); } diff --git a/public/app/features/panel/solo_panel_ctrl.js b/public/app/features/panel/solo_panel_ctrl.ts similarity index 65% rename from public/app/features/panel/solo_panel_ctrl.js rename to public/app/features/panel/solo_panel_ctrl.ts index a25c5f90c27..ffe1c6f7dea 100644 --- a/public/app/features/panel/solo_panel_ctrl.js +++ b/public/app/features/panel/solo_panel_ctrl.ts @@ -1,14 +1,9 @@ -define([ - 'angular', - 'jquery', -], -function (angular, $) { - "use strict"; +import angular from 'angular'; - var module = angular.module('grafana.routes'); - - module.controller('SoloPanelCtrl', function($scope, $routeParams, $location, dashboardLoaderSrv, contextSrv) { +export class SoloPanelCtrl{ + /** @ngInject */ + constructor($scope, $routeParams, $location, dashboardLoaderSrv, contextSrv) { var panelId; $scope.init = function() { @@ -26,26 +21,25 @@ function (angular, $) { }; $scope.initPanelScope = function() { - var panelInfo = $scope.dashboard.getPanelInfoById(panelId); + let panelInfo = $scope.dashboard.getPanelInfoById(panelId); // fake row ctrl scope $scope.ctrl = { - row: panelInfo.row, dashboard: $scope.dashboard, }; - $scope.ctrl.row.height = $(window).height(); $scope.panel = panelInfo.panel; + $scope.panel.soloMode = true; $scope.$index = 0; if (!$scope.panel) { $scope.appEvent('alert-error', ['Panel not found', '']); return; } - - $scope.panel.span = 12; }; $scope.init(); - }); -}); + } +} + +angular.module('grafana.routes').controller('SoloPanelCtrl', SoloPanelCtrl);