This commit is contained in:
2022-10-15 22:24:22 +02:00
parent 0057bbcd96
commit 85125c7d6b
19 changed files with 299 additions and 27 deletions

View File

@ -6,6 +6,16 @@
*/
// any CSS you import will output into a single css file (app.css in this case)
import 'jquery';
// start the Stimulus application
import GetEvent from './js/getCodeBarre';
import './bootstrap';
$(document).ready(()=>{
setTimeout(()=>{
// utils.init();
GetEvent.init()
}, 200);
})

29
assets/js/getCodeBarre.js Normal file
View File

@ -0,0 +1,29 @@
export default class GetEvent{
static init(){
this.getEvent()
}
static getEvent(){
console.log("test init");
let saisie = $('#saisie');
saisie.focus();
let value;
document.addEventListener('keydown', function (event) {
saisie.focus();
if(event.code == 'Tab'){
value = saisie.val();
saisie.val('')
$.ajax({
url: '/api/get-code-barre-type',
method: "POST",
dataType: "json",
data: {'codeBarre': value},
success: function(response){
console.log(response)
}
})
}
})
}
}