Last active
March 8, 2018 20:01
-
-
Save Dimls/d26bba3f419c85d2f3a94f458618fcc8 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
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