Skip to content

Commit

Permalink
Merge pull request #12953 from andreubisquerra/develop
Browse files Browse the repository at this point in the history
Wait search finished before add product with enter
  • Loading branch information
eldy committed Jan 29, 2020
2 parents 6cccce3 + 0beb78a commit 2ce3ea8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions htdocs/takepos/takepos.php
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 2ce3ea8

Please sign in to comment.