From 3cc78f06799b0c91957767e8d9255e67b30edd96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 24 Oct 2016 11:20:11 +0200 Subject: Added shortcuts --- app/Resources/static/themes/_global/js/tools.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'app/Resources') diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index 55de090c..9a98f0a6 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -1,4 +1,5 @@ const $ = require('jquery'); +require('mousetrap'); /* Allows inline call qr-code call */ import jrQrcode from 'jr-qrcode'; // eslint-disable-line @@ -51,3 +52,14 @@ function initExport() { } export { savePercent, retrievePercent, initFilters, initExport }; + +/** Shortcuts **/ + +/* Go to */ +Mousetrap.bind('g u', function() { window.location.href = Routing.generate('homepage') }); +Mousetrap.bind('g s', function() { window.location.href = Routing.generate('starred') }); + +/* Actions */ +Mousetrap.bind('g a', function() { + $("#nav-btn-add").trigger("click"); +}); -- cgit v1.2.3