Migliorie minori

This commit is contained in:
Luca 2021-05-27 15:44:29 +02:00
parent 4744d15d94
commit 6889730dde
2 changed files with 30 additions and 27 deletions

View File

@ -94,9 +94,14 @@ echo '
<script> <script>
// Lettura codici da lettore barcode // Lettura codici da lettore barcode
$(document).unbind("keyup"); $(document).unbind("keyup");
$("#modals > div").on( "shown.bs.modal", function(){ $("#modals > div").on( "shown.bs.modal", function(){';
if (setting('Attiva scorciatoie da tastiera')) {
echo 'EnableHotkeys()';
}
echo '
$("#barcode").focus(); $("#barcode").focus();
}); });
$(document).on("keyup", function (event) { $(document).on("keyup", function (event) {
if ($(":focus").is("input, textarea")) { if ($(":focus").is("input, textarea")) {
return; return;
@ -241,15 +246,14 @@ echo '
$("#barcode").focus(); $("#barcode").focus();
} }
} }
</script>';
if (setting('Attiva scorciatoie da tastiera')) {
echo '
<script>
hotkeys("f8,f9,f10", function(event, handler) {
function EnableHotkeys(){
hotkeys("f7,f8,f9,f10", function(event, handler) {
switch (handler.key) { switch (handler.key) {
case "f7":
event.preventDefault();
$("#barcode").focus();
break;
case "f8": case "f8":
event.preventDefault(); event.preventDefault();
input("causale").set("1"); input("causale").set("1");
@ -264,11 +268,10 @@ hotkeys("f8,f9,f10", function(event, handler) {
break; break;
default: alert(event); default: alert(event);
} }
}); });
}
</script>'; </script>';
}
echo ' echo '
<div class="hidden" id="info-articolo"> <div class="hidden" id="info-articolo">

View File

@ -21,7 +21,7 @@
"font-awesome": "^4.7.0", "font-awesome": "^4.7.0",
"fullcalendar": "^3.4.0", "fullcalendar": "^3.4.0",
"geocomplete": "^1.7.0", "geocomplete": "^1.7.0",
"hotkeys-js": "^3.7.3", "hotkeys-js": "^3.8.5",
"inputmask": "^3.3.9", "inputmask": "^3.3.9",
"jquery": "^3.5.1", "jquery": "^3.5.1",
"jquery-form": "^4.2.1", "jquery-form": "^4.2.1",