1
0
mirror of https://github.com/24eme/signaturepdf.git synced 2023-08-25 09:33:08 +02:00

Escape permet d'annuler la séléction courante

This commit is contained in:
Vincent LAURENT 2021-11-09 01:02:39 +01:00
parent ff1c0b5cfb
commit a496f122dc
2 changed files with 12 additions and 1 deletions

View File

@ -492,6 +492,17 @@ loadingTask.promise.then(function(pdf) {
}
document.addEventListener('keydown', function(event) {
if(event.key == 'Escape' && (event.target.tagName == "BODY" || event.target.name == "svg_2_add")) {
var input_selected = document.querySelector('input[name="svg_2_add"]:checked');
if(!input_selected) {
return;
}
input_selected.checked = false;
stateAddLock(false);
input_selected.dispatchEvent(new Event("change"));
input_selected.blur();
return;
}
if(event.target.tagName != "BODY") {
return;
}

View File

@ -33,7 +33,7 @@
<div id="container-pages" style="overflow: auto" class="col-12 pt-1 pb-1 text-center vh-100">
</div>
<div style="height: 55px;" class="d-md-none"></div>
<div class="offcanvas offcanvas-end show d-none d-md-block shadow-sm" data-bs-backdrop="false" data-bs-scroll="true" data-keyboard="false" tabindex="-1" id="offcanvasTop" aria-labelledby="offcanvasTopLabel" style="width: 350px;">
<div class="offcanvas offcanvas-end show d-none d-md-block shadow-sm" data-bs-backdrop="false" data-bs-scroll="true" data-bs-keyboard="false" tabindex="-1" id="offcanvasTop" aria-labelledby="offcanvasTopLabel" style="width: 350px;">
<div class="offcanvas-header mb-0 pb-0">
<h5 id="offcanvasTopLabel">Signature du PDF</h5>
<button type="button" class="btn-close text-reset d-md-none" data-bs-dismiss="offcanvas" aria-label="Close"></button>