-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Removed inline JavaScript from template #4141
Conversation
I didn't try to understand this logic deeply but it looks like your changes changed the semantics. Before that only for
false condition this initialization occured. Also, product/view/form template received knowledge about addToCart which is not correct. Should be done within initial template similar to positive branch of {{if}}:
|
@pivulic Thank you for your contribution. Please accept the contributors license agreement so this PR can be further processed. This can be done by clicking the "Details" link next to the "license/cla" check below. |
I have now clicked the Details link and accepted the license. But here it says I still haven't, maybe a temporary glitch? Not sure what you meant @orlangur, could you maybe commit your changes the way you think it should be? The idea is basically to remove the Inline JavaScript from addtocart.phtml |
@pivulic maybe because your githib email adress is not public? Maybe you can check... |
Internal issue MAGETWO-53439 |
@pivulic, I'm not going to rework this code, just tried to describe why current changes seem doubtful to me. So here is an example of correct inline JavaScript elimination in this file: f191737#diff-bcc11b36af8eaf52078666d9755945beL46 (note that there is still Here is where Correct implementation should result in two declarative /cc @guz-anton |
HI @pivulic , First of all we made usage Please review if suitable for you. Current PR I close. Fill free to comment if any notice you have. |
Nice! |
Problem
Difficult to extend the catalogAddToCart widget due to Inline JavaScript, something you strongly are against to according to: http://devdocs.magento.com/guides/v2.0/javascript-dev-guide/javascript/js_init.html