| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
window.onRemoveCartGroup = function () { |
| 10 |
removeCartGroup(this); |
| 11 |
}; |
| 12 |
|
| 13 |
|
| 14 |
window.toggleDiscoverFilters = function () { |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
var layout = document.querySelector('.discover-layout'); |
| 20 |
if (!layout) return; |
| 21 |
var open = layout.classList.toggle('filters-open'); |
| 22 |
this.classList.toggle('active', open); |
| 23 |
this.setAttribute('aria-expanded', open ? 'true' : 'false'); |
| 24 |
}; |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
window.onNotifySubmit = function () { |
| 29 |
submitNotify({ preventDefault: function () {} }); |
| 30 |
}; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
window.onSwitchSectionTab = function () { |
| 35 |
switchSectionTab(this, this.getAttribute('data-arg')); |
| 36 |
}; |
| 37 |
|
| 38 |
|
| 39 |
window.onPwywInput = function () { |
| 40 |
updatePwywButton(this.value); |
| 41 |
}; |
| 42 |
|
| 43 |
|
| 44 |
window.onAddToCartLink = function () { |
| 45 |
fetch('/api/cart/' + this.getAttribute('data-arg'), {method:'POST',headers:csrfHeaders()}).then(function(r){if(!r.ok)throw new Error('Failed');return r.json()}).then(function(){window.location.href='/cart'}).catch(function(){alert('Could not add to cart. Please try again.')}); |
| 46 |
}; |
| 47 |
|