| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
window.noop = function () {}; |
| 12 |
|
| 13 |
|
| 14 |
window.onRemoveCartGroup = function () { |
| 15 |
removeCartGroup(this); |
| 16 |
}; |
| 17 |
|
| 18 |
|
| 19 |
window.toggleDiscoverFilters = function () { |
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
var layout = document.querySelector('.discover-layout'); |
| 25 |
if (!layout) return; |
| 26 |
var open = layout.classList.toggle('filters-open'); |
| 27 |
this.classList.toggle('active', open); |
| 28 |
this.setAttribute('aria-expanded', open ? 'true' : 'false'); |
| 29 |
}; |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
window.onNotifySubmit = function () { |
| 34 |
submitNotify({ preventDefault: function () {} }); |
| 35 |
}; |
| 36 |
|
| 37 |
|
| 38 |
window.onOpenCollectionPicker = function () { |
| 39 |
openCollectionPicker(this.getAttribute('data-arg'), this); |
| 40 |
}; |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
window.onSwitchSectionTab = function () { |
| 45 |
switchSectionTab(this, this.getAttribute('data-arg')); |
| 46 |
}; |
| 47 |
|
| 48 |
|
| 49 |
window.onSetActiveTab = function () { |
| 50 |
setActiveTab(this); |
| 51 |
}; |
| 52 |
|
| 53 |
|
| 54 |
window.onPwywInput = function () { |
| 55 |
updatePwywButton(this.value); |
| 56 |
}; |
| 57 |
|
| 58 |
|
| 59 |
window.onAddToCartLink = function () { |
| 60 |
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.')}); |
| 61 |
}; |
| 62 |
|
| 63 |
|
| 64 |
window.historyBack = function () { |
| 65 |
window.history.back(); |
| 66 |
}; |
| 67 |
|
| 68 |
|
| 69 |
window.printPage = function () { |
| 70 |
window.print(); |
| 71 |
}; |
| 72 |
|