Merge branch 'v4ux' of https://github.com/grafana/grafana into v4ux

This commit is contained in:
Matt 2016-11-03 17:41:54 -04:00
commit 80f8c0712c
5 changed files with 29 additions and 3 deletions

View File

@ -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) {

View File

@ -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');
});

View File

@ -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);

View File

@ -54,6 +54,12 @@
tooltip="Uncheck, then save and reload to disable all dashboard editing"
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"

View File

@ -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;
}