From 2742f6aac98aa5ae61ec11139064c7d206f26567 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Wed, 4 Feb 2015 15:07:29 +0100 Subject: [PATCH] SONAR-5862 Users should have a way to easily discover that shortcuts exist and understand their scope --- server/sonar-web/src/main/js/nav/app.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/server/sonar-web/src/main/js/nav/app.js b/server/sonar-web/src/main/js/nav/app.js index a9ac2f9e22d..36e52658a1d 100644 --- a/server/sonar-web/src/main/js/nav/app.js +++ b/server/sonar-web/src/main/js/nav/app.js @@ -57,6 +57,19 @@ define([ }); }); + App.addInitializer(function () { + var that = this; + $(window).on('keypress', function (e) { + var tagName = e.target.tagName; + if (tagName !== 'INPUT' && tagName !== 'SELECT' && tagName !== 'TEXTAREA') { + var code = e.keyCode || e.which; + if (code === 63) { + that.navbarView.showShortcutsHelp(); + } + } + }); + }); + window.requestMessages().done(function () { App.start(); }); -- 2.39.5