Skip to content

Instantly share code, notes, and snippets.

@Dimls
Last active March 8, 2018 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Dimls/d26bba3f419c85d2f3a94f458618fcc8 to your computer and use it in GitHub Desktop.
Save Dimls/d26bba3f419c85d2f3a94f458618fcc8 to your computer and use it in GitHub Desktop.
theme.Sections.ProductLargeTemplate = function (container) {
var $mainContainer = $(container);
if($mainContainer.closest('[data-section-id="product-alternate-template"]').length > 0) {
theme.Products.init(container);
theme.Slick.initProdPhoto(container);
theme.Slick.initVariant(container);
theme.Variants.init(container, true);
theme.ProductPage.init(container);
} else {
$mainContainer.find('.desktop-featured-product').each(function() {
var $container = $(this);
theme.Products.init($container);
theme.Slick.initFeaturedCollection($container);
theme.Variants.init($container);
});
}
};
theme.Sections.ProductLargeTemplate.prototype = {
onUnload: function(evt) {
var container = $('[data-section-id]', evt.target)[0];
theme.Slick.uninitFeaturedCollection(container);
theme.Slick.uninitProdPhoto(container);
theme.Slick.uninitVariant(container);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment