Commit abf1f6a1 by Torkel Ödegaard

ux(dashboard): added back hide controls toggle and shortcut, #6442

parent d0513d3a
......@@ -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) {
......
......@@ -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');
});
......
......@@ -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);
......
......@@ -55,6 +55,12 @@
checked="dashboard.editable"
label-class="width-11">
</gf-form-switch>
<gf-form-switch class="gf-form"
label="Hide Controls"
tooltip="Hide row controls. Shortcut: CTRL+H"
checked="dashboard.hideControls"
label-class="width-11">
</gf-form-switch>
<gf-form-switch class="gf-form"
label="Shared Crosshair"
tooltip="Shared Crosshair line on all graphs. Shortcut: CTRL+O"
......
......@@ -18,6 +18,7 @@
.dashnav-refresh-action,
.dashnav-zoom-out,
.dashnav-action-icons,
.dash-row-menu,
.dashnav-move-timeframe {
display: none;
}
......@@ -27,6 +28,15 @@
}
}
.hide-controls {
.add-row-panel-hint {
display: none;
}
.dash-row-menu {
display: none;
}
}
div.flot-text {
color: $text-color !important;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment