website_item.js 908 B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * Client code for the website_item template.
  3. */
  4. /**
  5. * Template events
  6. */
  7. Template.website_item.events({
  8. "click .js-upvote": function (event) {
  9. // Example of how you can access the id for the website in the database
  10. // (this is the data context for the template)
  11. const websiteId = this._id;
  12. console.log("Up voting website with id " + websiteId);
  13. // Put the code in here to add a vote to a website!
  14. // Prevent the button from reloading the page.
  15. return false;
  16. },
  17. "click .js-downvote": function (event) {
  18. // example of how you can access the id for the website in the database
  19. // (this is the data context for the template)
  20. const websiteId = this._id;
  21. console.log("Down voting website with id " + websiteId);
  22. // Put the code in here to remove a vote from a website!
  23. // Prevent the button from reloading the page
  24. return false;
  25. }
  26. });