Add pricing tab switching JS and bmtForm for buy buttons
This commit is contained in:
@@ -603,4 +603,34 @@ const isHome = currentPath === '/';
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
<script is:inline>
|
||||||
|
// Pricing page: tab switching and BMT Micro form handling
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
var nav = document.getElementById('buy-nav');
|
||||||
|
var panels = document.getElementById('buy-panels');
|
||||||
|
if (nav && panels) {
|
||||||
|
var tabs = nav.querySelectorAll('a');
|
||||||
|
var panes = panels.querySelectorAll('.panel');
|
||||||
|
// Show first panel
|
||||||
|
if (panes.length > 0) panes[0].style.display = 'block';
|
||||||
|
// Tab click handlers
|
||||||
|
tabs.forEach(function(tab, i) {
|
||||||
|
tab.addEventListener('click', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
tabs.forEach(function(t) { t.classList.remove('current'); });
|
||||||
|
panes.forEach(function(p) { p.style.display = 'none'; });
|
||||||
|
tab.classList.add('current');
|
||||||
|
if (panes[i]) panes[i].style.display = 'block';
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// BMT Micro form submit
|
||||||
|
function bmtForm(el) {
|
||||||
|
var form = el.closest('form');
|
||||||
|
var pid = form.querySelector('.product-id');
|
||||||
|
if (pid) pid.value = el.getAttribute('data-value');
|
||||||
|
form.submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user