Merge pull request #12953 from andreubisquerra/develop

Wait search finished before add product with enter
This commit is contained in:
Laurent Destailleur 2020-01-29 11:05:26 +01:00 committed by GitHub
commit 2ce3ea8234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -440,7 +440,7 @@ function New() {
function Search2() {
console.log("Search2 Call ajax search to replace products");
if(window.event.keyCode == 13) ClickProduct(0);
if(window.event.keyCode == 13) var key=13;
pageproducts=0;
jQuery(".wrapper2 .catwatermark").hide();
$.getJSON('<?php echo DOL_URL_ROOT ?>/takepos/ajax/ajax.php?action=search&term='+$('#search').val(), function(data) {
@ -459,7 +459,9 @@ function Search2() {
$("#prodiv"+i).data("rowid", data[i]['rowid']);
$("#prodiv"+i).data("iscat", 0);
}
});
}).always(function() {
if(key==13) ClickProduct(0);
});
}
function Edit(number) {