Commit 16e79809 by Torkel Ödegaard

Help: added help modal, accessed by shortcut '?', the help modal only contains a…

Help: added help modal, accessed by shortcut '?', the help modal only contains a list of all shortcuts right now but will be extended in the future, #952
parent e3e08cf8
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
**Misc** **Misc**
- [Issue #938](https://github.com/grafana/grafana/issues/938). Panel: Plugin panels now reside outside of app/panels directory - [Issue #938](https://github.com/grafana/grafana/issues/938). Panel: Plugin panels now reside outside of app/panels directory
- [Issue #952](https://github.com/grafana/grafana/issues/952). Help: Shortcut "?" to open help modal with list of all shortcuts
**Fixes** **Fixes**
- [Issue #925](https://github.com/grafana/grafana/issues/925). Graph: bar width calculation fix for some edge cases (bars would render on top of each other) - [Issue #925](https://github.com/grafana/grafana/issues/925). Graph: bar width calculation fix for some edge cases (bars would render on top of each other)
......
<div class="modal-body">
<div class="dashboard-editor-header">
<div class="dashboard-editor-title">
<i class="icon icon-keyboard"></i>
Keyboard shutcuts
</div>
</div>
<div class="dashboard-editor-body">
<table class="shortcut-table">
<tr>
<th></th>
<th style="text-align: left;">Dashboard wide shortcuts</th>
</tr>
<tr>
<td style="text-align: right;"><span class="label label-info">ESC</span></td>
<td>Exit fullscreen edit/view mode, close search or any editor view</td>
</tr>
<tr>
<td><span class="label label-info">CTRL+F</span></td>
<td>Open dashboard search view (also contains import/playlist controls)</td>
</tr>
<tr>
<td><span class="label label-info">CTRL+S</span></td>
<td>Save dashboard</td>
</tr>
<tr>
<td><span class="label label-info">CTRL+H</span></td>
<td>Hide row controls</td>
</tr>
<tr>
<td><span class="label label-info">CTRL+Z</span></td>
<td>Zoom out</td>
</tr>
<tr>
<td><span class="label label-info">CTRL+R</span></td>
<td>Refresh (Fetches new data and rerenders panels)</td>
</tr>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-info" ng-click="dismiss()">Close</button>
</div>
...@@ -8,7 +8,7 @@ function(angular, $) { ...@@ -8,7 +8,7 @@ function(angular, $) {
var module = angular.module('grafana.services'); var module = angular.module('grafana.services');
module.service('dashboardKeybindings', function($rootScope, keyboardManager) { module.service('dashboardKeybindings', function($rootScope, keyboardManager, $modal, $q) {
this.shortcuts = function(scope) { this.shortcuts = function(scope) {
...@@ -22,6 +22,24 @@ function(angular, $) { ...@@ -22,6 +22,24 @@ function(angular, $) {
keyboardManager.unbind('esc'); keyboardManager.unbind('esc');
}); });
var helpModalScope = null;
keyboardManager.bind('shift+¿', function() {
if (helpModalScope) { return; }
helpModalScope = $rootScope.$new();
var helpModal = $modal({
template: './app/partials/help_modal.html',
persist: false,
show: false,
scope: helpModalScope,
keyboard: false
});
helpModalScope.$on('$destroy', function() { helpModalScope = null; });
$q.when(helpModal).then(function(modalEl) { modalEl.modal('show'); });
}, { inputDisabled: true });
keyboardManager.bind('ctrl+f', function() { keyboardManager.bind('ctrl+f', function() {
scope.appEvent('show-dash-editor', { src: 'app/partials/search.html' }); scope.appEvent('show-dash-editor', { src: 'app/partials/search.html' });
}, { inputDisabled: true }); }, { inputDisabled: true });
......
...@@ -552,3 +552,9 @@ select.grafana-target-segment-input { ...@@ -552,3 +552,9 @@ select.grafana-target-segment-input {
.grafana-tip { .grafana-tip {
padding-left: 5px; padding-left: 5px;
} }
.shortcut-table {
td { padding: 3px; }
th:last-child { text-align: left; }
td:first-child { text-align: right; }
}
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