1;(function() { 2 'use strict'; 3 4 function UIBitrix24AccordionInit() 5 { 6 this.attributes = { 7 active: 'data-active', 8 accordion: 'data-bx-ui-accordion', 9 item: 'data-bx-ui-accordion-item', 10 clicker: 'data-bx-ui-accordion-clicker', 11 content: 'data-bx-ui-accordion-content', 12 }; 13 14 this.init(); 15 } 16 17 UIBitrix24AccordionInit.prototype = { 18 init: function() { 19 let accordions = document.querySelectorAll('[' + this.attributes.accordion + ']'); 20 21 for (let i = 0; i < accordions.length; i++) 22 { 23 let accordion = accordions[i]; 24 25 if (!BX.type.isElementNode(accordion)) 26 { 27 continue; 28 } 29 30 let items = accordion.querySelectorAll('[' + this.attributes.item + ']'); 31 32 for (let j = 0; j < items.length; j++) 33 { 34 let item = items[j]; 35 36 if (!BX.type.isElementNode(item)) 37 { 38 continue; 39 } 40 41 let clicker = item.querySelector('[' + this.attributes.clicker + ']'); 42 let content = item.querySelector('[' + this.attributes.content + ']'); 43 44 if ( 45 !BX.type.isElementNode(clicker) || 46 !BX.type.isElementNode(content) 47 ) 48 { 49 continue; 50 } 51 52 let _this = this; 53 54 BX.bind(clicker, 'click', function() { 55 if (item.hasAttribute(_this.attributes.active)) 56 { 57 item.removeAttribute(_this.attributes.active); 58 } 59 else 60 { 61 item.setAttribute(_this.attributes.active, ''); 62 } 63 }); 64 } 65 } 66 } 67 }; 68 69 if (window.frameCacheVars !== undefined) 70 { 71 BX.addCustomEvent('onFrameDataReceived', function() { 72 (new UIBitrix24AccordionInit()); 73 }); 74 } 75 else 76 { 77 BX.ready(function() { 78 (new UIBitrix24AccordionInit()); 79 }); 80 } 81})();
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.