Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. Assignment
  2. Create a document that you can share with your mentor (like a Google Doc, DropBox Paper, or Gist).
  3. For the 3 remaining user stories (add items, check/uncheck items, and delete items), plan out each function in pseudocode (plain language).
  4.  
  5.  
  6.  
  7. addItem
  8. //utilize Jquery to listen to click of 'Add button' (or enter pressed while the input form is targetted)
  9. //prevent default behaviour to GET or POST if we are using a form element
  10. //create a new variable (nameToAdd) that will hold the string that is currently in the input form
  11. //Update the global variable shopping list to append the new object
  12. //object will have 3 keys, value pairs
  13. //1. unique id
  14. //2. name: nameToAdd
  15. //3. checked : false
  16. //re-render shopping list to reflect the new addition
  17.  
  18. check.uncheck items
  19. //listen for an event where 'check-toggle' is clicked.
  20. //create a new variable (target-id) to identify the item to toggle
  21. //iterate through the global shopping list to locate item to update via target-id
  22. //update the attribute checked of the object targetted
  23. //re-render shopping list to reflect the new status of object targetted
  24.  
  25. delete items
  26. //listen for an event where 'delete button' is clicked.
  27. //create a new variable (target-id) to identify the item to delete
  28. //iterate through the global shopping list to locate index of object to remove via target-id
  29. //remove the object from the global shopping list
  30. //re-render shopping list to reflect the new list without deleted object
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement