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
da42e4c6
Commit
da42e4c6
authored
Jul 02, 2021
by
Alexis Aoun
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor des fonctions qui geres le css des btns des popup
parent
00edd610
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
24 deletions
+27
-24
reception_produits.js
reception/static/js/reception_produits.js
+27
-24
No files found.
reception/static/js/reception_produits.js
View file @
da42e4c6
...
...
@@ -112,22 +112,7 @@ function select_product_from_bc(barcode) {
else
if
(
qtyIsPriceToWeight
){
openModal
(
$
(
'#templates #modal_confirm_price_to_weight'
).
html
(),
price_to_weight_is_wrong
,
'Non'
,
false
,
true
,
price_to_weight_confirmed_callback
(
found
,
p
));
//On inverse en quelque sorte les boutons succes et d'annulation en mettant "Oui" sur le btn d'annulation
// et "Non" sur le bouton de reussite.
//Cela nous permet de reecrire moins de code puisque si la reponse est Oui on ne veut
//rien modifier et sortir du pop up, ce qui correspond au comportement du bouton annulation
//(ou aussi appeler cancel button)
document
.
querySelector
(
'#modal_closebtn_bottom'
).
innerHTML
=
'Oui'
;
document
.
getElementById
(
"modal_closebtn_bottom"
).
style
.
backgroundColor
=
"green"
;
document
.
getElementsByClassName
(
"btn--success"
)[
0
].
style
.
backgroundColor
=
"red"
;
document
.
querySelector
(
'#product_to_verify'
).
innerHTML
=
p
.
data
[
0
];
document
.
querySelector
(
'#price_to_verify'
).
innerHTML
=
p
.
data
[
6
];
document
.
getElementById
(
"new_price_to_weight"
).
style
.
display
=
"none"
;
document
.
getElementsByClassName
(
"btn--success"
)[
0
].
style
.
display
=
""
;
setupPopUpBtnStyle
(
p
);
}
...
...
@@ -213,19 +198,13 @@ function price_to_weight_confirmed_callback (found, p){
editProductInfo
(
found
.
data
,
found
.
data
.
product_qty
);
if
(
found
.
place
===
'to_process'
)
{
let
row
=
table_to_process
.
row
(
$
(
'#'
+
found
.
data
.
product_id
[
0
]));
remove_from_toProcess
(
row
,
found
.
data
);
}
document
.
getElementsByClassName
(
"btn--success"
)[
0
].
style
.
display
=
""
;
document
.
getElementsByClassName
(
"btn--success"
)[
0
].
style
.
backgroundColor
=
""
;
document
.
querySelector
(
'#modal_closebtn_bottom'
).
style
.
backgroundColor
=
""
;
resetPopUpButtons
();
}
}
}
}
function
price_to_weight_is_wrong
(){
document
.
getElementById
(
"new_price_to_weight"
).
style
.
display
=
""
;
document
.
getElementsByClassName
(
"btn--success"
)[
0
].
style
.
display
=
"none"
;
...
...
@@ -233,6 +212,30 @@ function price_to_weight_is_wrong(){
priceToWeightIsCorrect
=
false
;
}
function
setupPopUpBtnStyle
(
p
){
//On inverse en quelque sorte les boutons succes et d'annulation en mettant "Oui" sur le btn d'annulation
// et "Non" sur le bouton de reussite.
//Cela nous permet de reecrire moins de code puisque si la reponse est Oui on ne veut
//rien modifier et sortir du pop up, ce qui correspond au comportement du bouton annulation
//(ou aussi appeler cancel button)
document
.
querySelector
(
'#modal_closebtn_bottom'
).
innerHTML
=
'Oui'
;
document
.
getElementById
(
"modal_closebtn_bottom"
).
style
.
backgroundColor
=
"green"
;
document
.
getElementsByClassName
(
"btn--success"
)[
0
].
style
.
backgroundColor
=
"red"
;
document
.
querySelector
(
'#product_to_verify'
).
innerHTML
=
p
.
data
[
0
];
document
.
querySelector
(
'#price_to_verify'
).
innerHTML
=
p
.
data
[
6
];
document
.
getElementById
(
"new_price_to_weight"
).
style
.
display
=
"none"
;
document
.
getElementsByClassName
(
"btn--success"
)[
0
].
style
.
display
=
""
;
}
function
resetPopUpButtons
()
{
document
.
getElementsByClassName
(
"btn--success"
)[
0
].
style
.
display
=
""
;
document
.
getElementsByClassName
(
"btn--success"
)[
0
].
style
.
backgroundColor
=
""
;
document
.
querySelector
(
'#modal_closebtn_bottom'
).
style
.
backgroundColor
=
""
;
}
/* INIT */
// Get order(s) data from server
...
...
Damien Moulard
@DamienM
mentioned in commit
1835290c
Jan 17, 2022
mentioned in commit
1835290c
mentioned in commit 1835290c2a6ff23629dd84d8d34ae2c61cb8406d
Toggle commit list
Damien Moulard
@DamienM
mentioned in merge request
!105 (merged)
Jan 17, 2022
mentioned in merge request
!105 (merged)
mentioned in merge request !105
Toggle commit list
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