Commit 3c143525 by Torkel Ödegaard

feat(ux dashboard editmode): added shortcut to setting menu, #6442

parent 8980f481
......@@ -52,7 +52,12 @@
<li ng-if="::showSettingsMenu" class="dropdown">
<a class="pointer" ng-click="hideTooltip($event)" bs-tooltip="'Manage dashboard'" data-placement="bottom" data-toggle="dropdown"><i class="fa fa-cog"></i></a>
<ul class="dropdown-menu">
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="dashboard.toggleEditMode();">Enter Build Mode</a></li>
<li ng-if="dashboardMeta.canEdit" class="dropdown-menu-item-with-shortcut">
<a class="pointer" ng-click="dashboard.toggleEditMode();">
Build Mode
<span class="dropdown-menu-item-shortcut">b</span>
</a>
</li>
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="openEditView('settings');">Settings</a></li>
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="openEditView('annotations');">Annotations</a></li>
<li ng-if="dashboardMeta.canEdit"><a class="pointer" ng-click="openEditView('templating');">Templating</a></li>
......
......@@ -48,7 +48,7 @@ function(angular, $) {
scope.broadcastRefresh();
}, { inputDisabled: true });
keyboardManager.bind('ctrl+b', function() {
keyboardManager.bind('b', function() {
scope.dashboard.toggleEditMode();
}, { inputDisabled: true });
......
......@@ -76,7 +76,6 @@ module.directive('grafanaPanel', function($rootScope) {
// set initial height
if (!ctrl.containerHeight) {
console.log('setting initial height');
ctrl.calculatePanelHeight();
panelContainer.css({minHeight: ctrl.containerHeight});
lastHeight = ctrl.containerHeight;
......
......@@ -258,3 +258,23 @@
z-index: 1051;
margin-top: 2px; // give it some space to breathe
}
.dropdown-menu-item-with-shortcut {
a {
min-width: 12rem;
}
}
.dropdown-menu-item-shortcut {
display: block;
float: right;
color: $text-muted;
&::before {
font-family: FontAwesome;
width: 2rem;
display: inline-block;
text-align: center;
content: "\f11c";
}
}
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