1(function($bs) { 2 const CLASS_NAME = 'has-child-dropdown-show'; 3 $bs.Dropdown.prototype.toggle = function(_orginal) { 4 return function() { 5 document.querySelectorAll('.' + CLASS_NAME).forEach(function(e) { 6 e.classList.remove(CLASS_NAME); 7 }); 8 if (this._element.closest('.dropdown') != null) { 9 let dd = this._element.closest('.dropdown').parentNode.closest('.dropdown'); 10 for (; dd && dd !== document; dd = dd.parentNode.closest('.dropdown')) { 11 dd.classList.add(CLASS_NAME); 12 } 13 } 14 15 return _orginal.call(this); 16 }; 17 }($bs.Dropdown.prototype.toggle); 18 19 document.querySelectorAll('.dropdown').forEach(function(dd) { 20 dd.addEventListener('hide.bs.dropdown', function(e) { 21 if(this.classList.contains(CLASS_NAME)) { 22 this.classList.remove(CLASS_NAME); 23 e.preventDefault(); 24 } 25 e.stopPropagation(); 26 }); 27 }); 28 29 document.querySelectorAll('.dropdown [data-bs-toggle="dropdown"]').forEach(function(dd) { 30 dd.addEventListener('click', function(e) { 31 var navbar = document.getElementById('main-navbar'), 32 clickableparent = navbar.classList.contains('clickableparent') ? 1 : 0, 33 isHover = navbar.classList.contains('navbarHover') ? 1 : 0, 34 href = e.currentTarget.getAttribute('href'); 35 if ( clickableparent && !e.currentTarget.classList.contains('show') ) { 36 if (isHover) { 37 e.preventDefault(); 38 } 39 if(href != '#') { 40 location.href = href; 41 } 42 } 43 }); 44 }); 45 46 function getDropdown(element) {
47 return $bs.Dropdown.getInstance(element) || new $bs.Dropdown(element); 48 } 49 50 document.querySelectorAll('.dropdown-hover, .dropdown-hover-all .dropdown').forEach(function(dd) { 51 dd.addEventListener('mouseenter', function(e) { 52 let toggle = e.target.querySelector(':scope>[data-bs-toggle="dropdown"]'); 53 if (!toggle.classList.contains('show')) { 54 getDropdown(toggle).toggle(); 55 } 56 }); 57 dd.addEventListener('mouseleave', function(e) { 58 let toggle = e.target.querySelector(':scope>[data-bs-toggle="dropdown"]'); 59 if (toggle.classList.contains('show')) { 60 getDropdown(toggle).toggle(); 61 } 62 }); 63 }); 64 65})(bootstrap);
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.