-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix/ad 55 onsubmit incorrect handling #38
Conversation
src/Resources/public/css/adyen.css
Outdated
.adyen-submit.hidden | ||
.adyen-submit.hidden, | ||
.dropin-container.hidden, | ||
.adyen-method-grid.hidden | ||
{ | ||
display: none; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing new line at the end, wrong code format in almost whole file.
use this https://www.freeformatter.com/css-beautifier.html
to format css
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
phpstorm re-format will be sufficient?
@@ -34,14 +34,14 @@ document.addEventListener('DOMContentLoaded', (e) => { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename the variables (remove the dollar sign, e.g. '$') - this is typical for jquery, and you wrote the vanilla js code, don't confuse the reader! : D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentional, we've discussed via DM.
@@ -34,14 +34,14 @@ document.addEventListener('DOMContentLoaded', (e) => { | |||
|
|||
showSubmitButton(false); | |||
|
|||
adyenMethod.querySelector('.adyen-method-grid, .dropin-container').style.display = ''; | |||
adyenMethod.querySelector('.adyen-method-grid, .dropin-container').classList.remove('hidden'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this works but it i dont think tis correct.
here querySelector will find First element with matching class - the rest will be missed - i dont know what you want to do here, but if you want just 1 specific element, you shouldnt need 2 classes to find it.
If you want ALL elements with these classes, you should use querySelectorAll, and then in array.forEach((item)=>{
item.classList.remove('hidden')
})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's intentional — the same code is executed in two different contexts; first .adyen-method-grid
, second .dropin-container
, it won't happen for two at once.
@@ -34,14 +34,14 @@ document.addEventListener('DOMContentLoaded', (e) => { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 19: showSubmitButton - schould be toggleSubmitButton or handleSubmitButton - cuz its toggling it's visibility, not just showing :D
@@ -10,6 +10,7 @@ | |||
|
|||
let checkout = null; | |||
let configuration = {}; | |||
let $form = $container.closest('form'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change variable name (dolar sign thing as above)
@@ -76,6 +101,8 @@ | |||
}; | |||
|
|||
const init = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inside init function you can add if statements, to check if its possible to run functions, and return nothing/error if not - you will not initialize adyen then - but idk if its smthing you need
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you recommend?
No description provided.