-
Notifications
You must be signed in to change notification settings - Fork 1.2k
pizza builder - Dani Demarchi #726
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
base: master
Are you sure you want to change the base?
Conversation
| // $(".btn-mushrooms").removeClass("active"); | ||
|
|
||
| // $(".btn-pepperonni").removeClass("active"); | ||
|
|
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.
Please make sure you do a "clean up" commit before you submit a pull request. Get rid of all unnecessary comments, extra empty lines (you should typically be using 1 at most) and any other unused variables or functions
lienekechee
left a comment
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.
Nice work Dani! Make sure to submit clean versions of your work though :)
|
|
||
| //setting default price on load | ||
| $(".total").html("13"); | ||
|
|
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.
I think it would be better (more explicit) to have a function called setupDefaultView() or something that shows what you are doing.
| } else { | ||
| $(".total").html(parseFloat(total) - 5); | ||
| } | ||
|
|
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.
Perhaps it might be an idea to declare the variables total and className globally, reassign them on click then write a function that takes in these two variables and updates $(".total"). This way you can avoid duplicate code 😉
| <li id="li-3">$1 green peppers</li> | ||
| <li id="li-4">$3 white sauce</li> | ||
| <li id="li-5">$5 gluten-free crust</li> | ||
| </ul> |
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.
I think naming these li-1 is a wee bit redundant, you are able to select them using the right query methods (e.g. eq(i) which gets the element at index i. If anything, I would give them a class that corresponds to the ingredient or to the ingredient button, if you find that useful in your implementation.
Here we go, guys.
Thanks for the help Matt! :)
Kind regards,
Dani