Fix takeaway/pickup toggle not saving in Firefox
Wire onchange listener via JS instead of inline attribute, matching the hiring toggle pattern. The zero-sized hidden checkbox wasn't firing inline onchange reliably. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
dfe2313ec5
commit
87eb5fa1f0
2 changed files with 5 additions and 2 deletions
|
|
@ -705,7 +705,7 @@
|
|||
</div>
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<label class="toggle">
|
||||
<input type="checkbox" id="orderTypeTakeaway" onchange="Portal.saveOrderTypes()">
|
||||
<input type="checkbox" id="orderTypeTakeaway">
|
||||
<span class="toggle-slider"></span>
|
||||
</label>
|
||||
<span>Takeaway / Pickup</span>
|
||||
|
|
|
|||
|
|
@ -868,7 +868,10 @@ const Portal = {
|
|||
// Order types
|
||||
const orderTypes = (biz.ORDERTYPES || biz.OrderTypes || '1').split(',');
|
||||
const takeawayCheckbox = document.getElementById('orderTypeTakeaway');
|
||||
if (takeawayCheckbox) takeawayCheckbox.checked = orderTypes.includes('2');
|
||||
if (takeawayCheckbox) {
|
||||
takeawayCheckbox.checked = orderTypes.includes('2');
|
||||
takeawayCheckbox.onchange = () => this.saveOrderTypes();
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('[Portal] Error loading business info:', err);
|
||||
|
|
|
|||
Reference in a new issue