diff --git a/public/app/core/directives/dash_class.js b/public/app/core/directives/dash_class.js index 91836e34150..7ac13a552ec 100644 --- a/public/app/core/directives/dash_class.js +++ b/public/app/core/directives/dash_class.js @@ -18,13 +18,17 @@ function (_, $, coreModule) { elem.toggleClass('panel-in-fullscreen', false); }); - $scope.$watch('dashboard.editMode', function() { + var lastHideControlsVal; + $scope.$watch('dashboard.hideControls', function() { if (!$scope.dashboard) { return; } - var editMode = $scope.dashboard.editMode; - elem.toggleClass('dash-edit-mode', editMode === true); + var hideControls = $scope.dashboard.hideControls; + if (lastHideControlsVal !== hideControls) { + elem.toggleClass('hide-controls', hideControls); + lastHideControlsVal = hideControls; + } }); $scope.$watch('playlistSrv', function(newValue) { diff --git a/public/app/core/services/keybindingSrv.ts b/public/app/core/services/keybindingSrv.ts index e9f234ff68a..4c6ec6af57c 100644 --- a/public/app/core/services/keybindingSrv.ts +++ b/public/app/core/services/keybindingSrv.ts @@ -85,6 +85,10 @@ export class KeybindingSrv { scope.broadcastRefresh(); }); + this.bind('ctrl+h', () => { + dashboard.hideControls = !dashboard.hideControls; + }); + this.bind(['ctrl+s', 'command+s'], () => { scope.appEvent('save-dashboard'); }); diff --git a/public/app/features/dashboard/model.ts b/public/app/features/dashboard/model.ts index 205300dde5b..ad28ce4643c 100644 --- a/public/app/features/dashboard/model.ts +++ b/public/app/features/dashboard/model.ts @@ -22,6 +22,7 @@ export class DashboardModel { rows: DashboardRow[]; time: any; timepicker: any; + hideControls: any; templating: any; annotations: any; refresh: any; @@ -51,6 +52,7 @@ export class DashboardModel { this.timezone = data.timezone || ''; this.editable = data.editable !== false; this.sharedCrosshair = data.sharedCrosshair || false; + this.hideControls = data.hideControls || false; this.time = data.time || { from: 'now-6h', to: 'now' }; this.timepicker = data.timepicker || {}; this.templating = this.ensureListExist(data.templating); diff --git a/public/app/features/dashboard/partials/settings.html b/public/app/features/dashboard/partials/settings.html index ad751c4a1bc..79cc7d12157 100644 --- a/public/app/features/dashboard/partials/settings.html +++ b/public/app/features/dashboard/partials/settings.html @@ -54,6 +54,12 @@ tooltip="Uncheck, then save and reload to disable all dashboard editing" checked="dashboard.editable" label-class="width-11"> + +