Sha256: ad8bc40eca718b4f12403b0a9b1d2794d6ae23c442ccb3c7004907d43e89e857
Contents?: true
Size: 903 Bytes
Versions: 16
Compression:
Stored size: 903 Bytes
Contents
document.addEventListener("spree:load", function() { const linkSwitcher = $('.link_switcher').select2() linkSwitcher.on('change', function() { const selectedLinkToValue = $(this).val() const linkSwitcherTarget = this.dataset.targetField || 'menu_item_link' const activePanel = document.querySelector(`div[data-panel-id='${linkSwitcherTarget}']`) const messagePanel = document.querySelector(`div[data-target-message-pannel='${linkSwitcherTarget}']`) const panelType = activePanel.dataset.panelType if (selectedLinkToValue === panelType) { activePanel.classList = '' activePanel.classList.add('d-block') messagePanel.classList = '' messagePanel.classList.add('d-none') } else { activePanel.classList = '' activePanel.classList.add('d-none') messagePanel.classList = '' messagePanel.classList.add('d-block') } }) })
Version data entries
16 entries across 16 versions & 1 rubygems