From acbc10ed0afb0a0130499fad79e742ce7453b8e2 Mon Sep 17 00:00:00 2001 From: n-peugnet Date: Sun, 20 Oct 2019 21:01:42 +0200 Subject: add display shortcut with ctrl + d --- app/view/templates/edittopbar.php | 3 ++- assets/js/edit.js | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/view/templates/edittopbar.php b/app/view/templates/edittopbar.php index 6f4db36..ec1a875 100644 --- a/app/view/templates/edittopbar.php +++ b/app/view/templates/edittopbar.php @@ -17,7 +17,8 @@ - + + display id() ?> diff --git a/assets/js/edit.js b/assets/js/edit.js index 567d1f3..efd29d6 100644 --- a/assets/js/edit.js +++ b/assets/js/edit.js @@ -27,10 +27,18 @@ function keyboardHandler(e) { switch (e.key) { // ctrl + s case 's': - e.preventDefault(); submitHandler(form); - return false; + break; + // ctrl + d + case 'd': + url = document.getElementById('update').getAttribute('href'); + window.open(url); + break; + default: + return true; } + e.preventDefault(); + return false; } } } -- cgit v1.2.3