|
@@ -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, $) {
|
|
|
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 });
|