image_share.js 482 B

12345678910111213141516171819
  1. // this is image_share.js
  2. Images = new Mongo.Collection("images");
  3. if (Meteor.isClient) {
  4. Template.images.helpers({ images: Images.find() });
  5. Template.images.events({
  6. "click .js-image": function (event) {
  7. $(event.target).css("width", "50px");
  8. },
  9. "click .js-del-image": function (event) {
  10. let imageId = this._id;
  11. console.log(imageId);
  12. $("#" + imageId).hide(200, function () {
  13. Images.remove({ _id: imageId });
  14. });
  15. }
  16. });
  17. }