Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
a051fc8b
Commit
a051fc8b
authored
Aug 30, 2021
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orders helper: color line on input focus
parent
e9c34726
Pipeline
#1277
passed with stage
in 2 minutes 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
+19
-4
oders_helper_style.css
orders/static/css/oders_helper_style.css
+7
-3
orders_helper.js
orders/static/js/orders_helper.js
+12
-1
No files found.
orders/static/css/oders_helper_style.css
View file @
a051fc8b
...
...
@@ -19,7 +19,7 @@
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
padding
:
5px
30px
5
px
30px
;
padding
:
8px
30px
8
px
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
:
#00
acc1
;
border
:
1px
solid
black
;
background-color
:
#00
bfdb
;
border
:
1px
solid
#008ea9
;
}
.pill_supplier_name
{
...
...
orders/static/js/orders_helper.js
View file @
a051fc8b
...
...
@@ -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'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment