parent
802f9d775f
commit
9d9c80dd6a
1 changed files with 5 additions and 4 deletions
|
@ -20,7 +20,8 @@ function hideBarcode() {
|
|||
function barcodeKeyPress(event) {
|
||||
var key = String.fromCharCode(event.charCode)
|
||||
var input = document.getElementById('crement')
|
||||
if ( input ) {
|
||||
var inputcount = document.querySelectorAll('[type="text"]').length + document.querySelectorAll('[type="number"]').length
|
||||
if ( input && inputcount == 1 ) {
|
||||
input.focus()
|
||||
}
|
||||
var focused = document.activeElement
|
||||
|
@ -29,7 +30,7 @@ function barcodeKeyPress(event) {
|
|||
} else if ( document.querySelector ) {
|
||||
focused = document.querySelector(":focus")
|
||||
}
|
||||
if ( focused == null || focused.tagName != "INPUT" ) {
|
||||
if ( inputcount <= 1 && ( focused == null || focused.tagName != "INPUT" ) ) {
|
||||
if ( event.keyCode === 13 ) {
|
||||
var input = document.getElementById('barcodeInput')
|
||||
if (input && barcodeBuf.length > 0) {
|
||||
|
|
Loading…
Reference in a new issue