diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php
index 911bf6bebe3..e95a8ac8346 100644
--- a/htdocs/takepos/pay.php
+++ b/htdocs/takepos/pay.php
@@ -205,11 +205,13 @@ $action_buttons = array(
"function" =>"reset()",
"span" => "style='font-size: 150%;'",
"text" => "C",
+ "class" => "poscolorblue"
),
array(
"function" => "parent.$.colorbox.close();",
"span" => "id='printtext'",
"text" => $langs->trans("Cancel"),
+ "class" => "poscolordelete"
),
);
$numpad=$conf->global->TAKEPOS_NUMPAD;
@@ -271,8 +273,9 @@ while($i < count($paiements)){
}
$class=($i==3)?"calcbutton3":"calcbutton2";
foreach($action_buttons as $button){
+ $newclass = $class.($button["class"]?" ".$button["class"]:"");
?>
-
+
diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php
index 24a57e17b52..0375fe09ead 100644
--- a/htdocs/takepos/takepos.php
+++ b/htdocs/takepos/takepos.php
@@ -135,6 +135,13 @@ function PrintCategories(first) {
}
}
+// Set the focus on search field but only on desktop. On tablet or smartphone, we don't to avoid to have the keyboard open automatically
+function setFocusOnSearchField() {
+ browser->layout == 'classic') { ?>
+ $("#search").focus();
+
+}
+
function MoreCategories(moreorless) {
console.log("MoreCategories moreorless="+moreorless+" pagecategories="+pagecategories);
if (moreorless=="more") {
@@ -165,7 +172,7 @@ function MoreCategories(moreorless) {
$("#catwatermark"+i).show();
}
- $("#search").focus();
+ setFocusOnSearchField();
}
function LoadProducts(position, issubcat=false) {
@@ -218,7 +225,7 @@ function LoadProducts(position, issubcat=false) {
}
});
- $("#search").focus();
+ setFocusOnSearchField();
}
function MoreProducts(moreorless) {
@@ -266,7 +273,7 @@ function MoreProducts(moreorless) {
}
});
- $("#search").focus();
+ setFocusOnSearchField();
}
function ClickProduct(position) {
@@ -286,7 +293,8 @@ function ClickProduct(position) {
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
});
}
- $("#search").focus();
+
+ setFocusOnSearchField();
}
function deleteline() {
@@ -331,7 +339,9 @@ function Refresh() {
function ClearSearch() {
console.log("ClearSearch");
- $("#search").val('').focus();
+ $("#search").val('');
+
+ setFocusOnSearchField();
}
function Search2() {
@@ -372,7 +382,8 @@ function Edit(number) {
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
$("#qty").html("trans("Qty"); ?>");
});
- $("#search").focus();
+
+ setFocusOnSearchField();
return;
}
else {
@@ -387,7 +398,8 @@ function Edit(number) {
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
$("#price").html("trans("Price"); ?>");
});
- $("#search").focus();
+
+ setFocusOnSearchField();
return;
}
else {
@@ -402,7 +414,8 @@ function Edit(number) {
//$('#poslines').scrollTop($('#poslines')[0].scrollHeight);
$("#reduction").html("trans("ReductionShort"); ?>");
});
- $("#search").focus();
+
+ setFocusOnSearchField();
return;
}
else {