1(function() { 2 'use strict'; 3 4 function initTabs(container) { 5 const buttons = container.querySelectorAll('.tab-button'); 6 const panes = container.querySelectorAll('.tab-pane'); 7 const blockId = container.id; 8 9 buttons.forEach(button => { 10 button.addEventListener('click', (e) => { 11 e.preventDefault(); 12 13 // УбиÑаем акÑивнÑй клаÑÑ Ñ Ð²ÑÐµÑ ÐºÐ½Ð¾Ð¿Ð¾Ðº в ÑÑом блоке 14 const blockButtons = container.querySelectorAll('.tab-button'); 15 blockButtons.forEach(btn => btn.classList.remove('active')); 16 17 // ÐобавлÑем акÑивнÑй клаÑÑ Ð½Ð°Ð¶Ð°Ñой кнопке 18 button.classList.add('active'); 19 20 // СкÑÑваем вÑе панели в ÑÑом блоке 21 const blockPanes = container.querySelectorAll('.tab-pane'); 22 blockPanes.forEach(pane => pane.classList.remove('active')); 23 24 // ÐоказÑваем нÑжнÑÑ Ð¿Ð°Ð½ÐµÐ»Ñ 25 const tabId = button.getAttribute('data-tab'); 26 const activePane = document.getElementById(tabId); 27 if (activePane) { 28 activePane.classList.add('active'); 29 } 30 }); 31 }); 32 } 33 34 // ÐниÑиализаÑÐ¸Ñ Ð¿Ñи загÑÑзке ÑÑÑаниÑÑ 35 document.addEventListener('DOMContentLoaded', function() { 36 const containers = document.querySelectorAll('.tabs-minimal'); 37 containers.forEach(container => { 38 initTabs(container); 39 }); 40 }); 41 42 // ÐÐ»Ñ Ð´Ð¸Ð½Ð°Ð¼Ð¸ÑеÑки подгÑÑжаемого конÑенÑа 43 document.addEventListener('ajaxSuccess', function() { 44 const containers = document.querySelectorAll('.tabs-minimal:not([data-initialized])'); 45 containers.forEach(container => { 46 container.setAttribute('data-initialized', 'true'); 47 initTabs(container); 48 }); 49 }); 50})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.