{% assign theme_layout = theme.theme_layout %}
{% capture body_class %}
{{ theme.layout_style }}
{% case theme_layout %}
{% when 'above_header' %}
above-header no-sidebar
{% when 'below_header' %}
below-header no-sidebar
{% when 'sidebar_header' %}
has-sidebar sidebar-header
{% when 'sidebar_header show_toggle' %}
has-sidebar sidebar-header sidebar-hidden
{% when 'sidebar_no_header' %}
has-sidebar sidebar-no-header
{% endcase %}
{% if theme.sidebar_position == 'left' %}
left-sidebar
{% else %}
right-sidebar
{% endif %}
{% endcapture %}
{% assign hide_nav_after_num_items = 10 %}
{{ page.name }} | {{ store.name }}
{{ head_content }}
function getCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
function eraseCookie(name) {
document.cookie = name+'=; Max-Age=-99999999;';
}
String.prototype.hashCode = function() {
var hash = 0, i, chr;
if (this.length === 0) return hash;
for (i = 0; i < this.length; i++) {
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0;
}
return hash;
};
if (themeOptions.hasAnnouncement) {
announceDiv = document.getElementById("announce-message");
if (announceDiv) {
announcementMessage=document.querySelector(".announcement-message-text").innerHTML;
hashedMessage=announcementMessage.hashCode();
cookieValue=getCookie("hide-announcement-message");
if (cookieValue) {
if (cookieValue != hashedMessage) {
announceDiv.classList.add('visible');
}
}
else {
announceDiv.classList.add('visible');
}
}
}
if (document.body.classList.contains('has-sidebar')) {
{% if theme.theme_layout == 'sidebar_header show_toggle' %}
if (window.innerWidth > 767 || inPreview) {
if (!window.localStorage.getItem('sidebar')) {
populateStorage();
} else {
setStyles();
}
}
{% else %}
document.body.classList.add('sidebar-visible');
{% endif %}
}
function populateStorage() {
window.localStorage.setItem('sidebar','hidden');
setStyles();
}
function setStyles() {
var sidebarState = window.localStorage.getItem('sidebar');
if (sidebarState == 'hidden') {
document.querySelector('.has-sidebar .sidebar').classList.add('hidden');
document.body.classList.remove('sidebar-visible');
}
else {
document.body.classList.remove('sidebar-hidden');
document.body.classList.add('sidebar-visible');
}
}
{% if categories.active.size > hide_nav_after_num_items || artists.active.size > hide_nav_after_num_items %}
if (!window.localStorage.getItem('show-sidebar-categories')) {
{% if categories.active.size > hide_nav_after_num_items %}
window.localStorage.setItem('show-sidebar-categories','hidden');
{% else %}
window.localStorage.setItem('show-sidebar-categories','visible');
{% endif %}
}
if (!window.localStorage.getItem('show-sidebar-artists')) {
{% if artists.active.size > hide_nav_after_num_items %}
window.localStorage.setItem('show-sidebar-artists','hidden');
{% else %}
window.localStorage.setItem('show-sidebar-artists','visible');
{% endif %}
}
if (window.localStorage.getItem('show-sidebar-categories') == 'hidden') {
document.querySelector('.nav-section-categories').classList.add('hidden-nav');
}
if (window.localStorage.getItem('show-sidebar-artists') == 'hidden') {
document.querySelector('.nav-section-artists').classList.add('hidden-nav');
}
{% endif %}
window.lazySizesConfig = window.lazySizesConfig || {};
window.lazySizesConfig.loadMode = 1;
var formatMoney = Format.money;
Format.money = function(number) {
{% case theme.money_format %}
{% when 'sign' %}
return formatMoney(number, true, true, false);
{% when 'code' %}
return formatMoney(number, true, false, true);
{% when 'sign_and_code' %}
return formatMoney(number, true, true, true);
{% endcase %}
};
{% if page.full_url contains '/product/' %}
Product.find('{{ product.permalink }}', processProduct)
{% endif %}