shopping bag items
')); if (html != '') html = html.replace('', ''); if (html != '') html = html.replace("", ""); $('#request-from-sizeChart').html(html); var el if (typeof target == 'string') el = document.getElementById(target) else if (target instanceof HTMLElement) { var triggers = target.getAttribute('aria-controls') el = triggers ? document.getElementById(triggers) : target } else { console.error('Target is not an ID or a reference to a DOM element') return } if (!el || !el.classList.contains('modal')) { console.error('Modal with the passed target not found') return } else if (el.classList.contains('modal--is-visible')) return var fo = focusOn && document.getElementById(focusOn) var ev = new CustomEvent('openModal', fo ? { detail: fo } : {}); el.dispatchEvent(ev); } }); } else { var el if (typeof target == 'string') el = document.getElementById(target) else if (target instanceof HTMLElement) { var triggers = target.getAttribute('aria-controls') el = triggers ? document.getElementById(triggers) : target } else { console.error('Target is not an ID or a reference to a DOM element') return } if (!el || !el.classList.contains('modal')) { console.error('Modal with the passed target not found') return } else if (el.classList.contains('modal--is-visible')) return var fo = focusOn && document.getElementById(focusOn) var ev = new CustomEvent('openModal', fo ? { detail: fo } : {}); el.dispatchEvent(ev); } } // Find the first close button within the visible modal and click it function closeModal() { var trigger = document.querySelector('.modal--is-visible .js-modal__close') trigger.click() } function __toggleDrawer(force, id) { var drawer = document.getElementById(id) if (!drawer || !drawer.classList.contains('drawer')) return var forceUsed = force != undefined // Before opening the drawer the wrong way, look for an element with [aria-controls={id}] to use // Otherwise, the drawer will open but you won't be able to close it the normal ways if (!drawer.classList.contains('drawer--is-visible') && (!forceUsed || force)) { var trigger = document.querySelector("[aria-controls='" + id + "']") if (trigger) { return trigger.click() } } forceUsed ? drawer.classList.toggle('drawer--is-visible', force) : drawer.classList.toggle('drawer--is-visible') }