Last active
December 11, 2020 13:07
-
-
Save thatdom/546d51c85330ab5003ca9efe4283eb25 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Covet.pics Widget - Javascript Events | |
// | |
// | |
// Events | |
// | |
// | |
// galleryReady - when gallery loads | |
// parameter: itemsCount - number of loaded items | |
// | |
document.addEventListener('galleryReady:covetPics', function(e) { | |
console.log('Gallery Id: ', e.detail.galleryId); | |
console.log('Gallery items count: ', e.detail.itemsCount); | |
console.log('Gallery element', e.detail.el); | |
}); | |
// | |
// modalOpen - when gallery modal opens | |
// | |
document.addEventListener('modalOpen:covetPics', function(e) { | |
console.log('modalOpen'); | |
}); | |
// | |
// modalClose - when gallery modal opens | |
// | |
document.addEventListener('modalClose:covetPics', function(e) { | |
console.log('modalClose'); | |
}); | |
// | |
// addToCart - when customer adds Product to cart in Covet.pics modal | |
// parameter: variantID - ID of product variant that's added to the cart | |
// parameter: productId - ID of product | |
// | |
document.addEventListener('addToCart:covetPics', function(e) { | |
console.log("addToCart", e.detail); | |
}); | |
// | |
// Methods | |
// | |
// | |
// openModal(modalID) - open Covet.pics modal | |
// parameter: modalID - ID of modal | |
// | |
document.querySelector('covet-pics-popup').openPopup(XYZ); | |
// | |
// openUpload() - open Covet.pics photo upload widget | |
// | |
document.querySelector('covet-pics-upload').openUpload(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment