Commit a051fc8b by Damien Moulard

orders helper: color line on input focus

parent e9c34726
Pipeline #1277 passed with stage
in 2 minutes 5 seconds
......@@ -19,7 +19,7 @@
flex-direction: column;
justify-content: center;
align-items: center;
padding: 5px 30px 5px 30px;
padding: 8px 30px 8px 30px;
margin: 0 10px 5px 10px;
}
......@@ -258,6 +258,10 @@
cursor: pointer;
}
.focused_line {
background-color: #76cf71 !important;
}
/* -- Footer */
#main_content_footer {
......@@ -284,8 +288,8 @@
}
.supplier_pill {
background-color: #00acc1;
border: 1px solid black;
background-color: #00bfdb;
border: 1px solid #008ea9;
}
.pill_supplier_name {
......
......@@ -1492,7 +1492,6 @@ function display_products(params) {
sort_order_dir
]
],
// stripeClasses: [], // Remove datatable cells coloring
orderClasses: false,
aLengthMenu: [
[
......@@ -1532,8 +1531,18 @@ function display_products(params) {
$('#main_content_footer').show();
$('#do_inventory').show();
// Color line on input focus
$('#products_table').on('focus', 'tbody td .product_qty_input', function () {
const row = $(this).closest('tr');
row.addClass('focused_line');
});
// Manage data on inputs blur
$('#products_table').on('blur', 'tbody td .product_qty_input', function () {
// Remove line coloring on input blur
const row = $(this).closest('tr');
row.removeClass('focused_line');
let val = ($(this).val() == '') ? 0 : $(this).val();
const id_split = $(this).attr('id')
......@@ -1807,6 +1816,8 @@ function display_total_values() {
*/
function update_main_screen(params) {
// Remove listener before recreating them
$('#products_table').off('focus', 'tbody td .product_qty_input');
$('#products_table').off('blur', 'tbody td .product_qty_input');
$('#products_table').off('change', 'tbody td .product_qty_input');
$('#products_table').off('click', 'tbody .product_not_from_supplier');
$('#products_table').off('click', 'tbody .product_ref_cell');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment