1jQuery(document).ready(function($){ 2 var vh = $(window).height(); 3 //alert(vh) 4 setTimeout(function(){ 5 //alert($("#mobile_menu1 li").length); 6 //alert($('#mobile_menu1').filter(function(){ return $(this).children("li").length > 0 })) 7 //console.log($('#mobile_menu1').filter(function(){ return $(this).children("li").length > 0 })) 8 //vh = $("#mobile_menu1 li").length * 48 + 220; 9 //$('#mobile_menu1').css({'height':vh, 'overflow-y':'scroll'}); 10 }, 200); 11 12 if ( $('body').hasClass('home')) { 13 var owlCarousel = $('.owl-carousel'); 14 15 owlCarousel.owlCarousel({ 16 loop: true, 17 center: false, 18 margin: 30, 19 nav: false, 20 dots: true, 21 responsive: { 22 0: { 23 items: 1, 24 margin: 0, 25 dots: true 26 }, 27 768: { 28 items: 2, 29 dots: true 30 }, 31 1000: { 32 items: 3 33 } 34 } 35 }); 36 37 $('.carousel-navigation .arrow-left').click(function() { 38 owlCarousel.trigger('prev.owl.carousel'); 39 }); 40 41 $('.carousel-navigation .arrow-right').click(function() { 42 owlCarousel.trigger('next.owl.carousel'); 43 }); 44 } 45 46 // is subscription page 47 if ( $('body').hasClass('page-id-1584')) { 48 49 var owlCarousel = $('.owl-carousel'); 50 51 owlCarousel.owlCarousel({ 52 loop: false, 53 center: false, 54 margin: 30, 55 nav: false, 56 dots: false, 57 responsive: { 58 0: { 59 items: 1 60 }, 61 768: { 62 items: 2 63 }, 64 1000: { 65 items: 4 66 } 67 } 68 }); 69 $('.owl-dot').click(function(){ 70 var dot = $(this); 71 setTimeout(function(){ 72 dot.siblings().removeClass('active'); 73 dot.addClass('active'); 74 }, 500); // Adjust this delay as needed 75 }); 76 $('.owl-carousel').on('changed.owl.carousel', function(event) { 77 var current = event.item.index; 78 var dot = $('.owl-dot').eq(current); 79 dot.click(); 80 }); 81 } 82 83 // is single performance page 84 if ( $('body').hasClass('single-productions')) { 85 86 // check if gallery is empty and hide section 87 if ($.trim($('.gallery-output').html()) === '') { 88 $('#gallery').hide(); 89 } 90 //check if synopsis is empty and hide 91 if ($('#synopsis').text().indexOf("No synopsis found") !== -1) { 92 $('#synopsis').hide(); 93 } 94 // check if cast is empty and hide 95 if ($('#crew').text().indexOf("No cast members found") !== -1) { 96 $('#crew').hide(); 97 } 98 99 // hide empty cast tabs 100 $('.et_pb_all_tabs .et_pb_tab').each(function(i, tab) { 101 var $tab = $(tab); 102 // Check if the tab is empty 103 if ($.trim($tab.text()) === '') { 104 // Get the corresponding tab title from .et_pb_tabs_controls 105 var $correspondingTabTitle = $('.et_pb_tabs_controls li').eq(i); 106 // Remove the corresponding tab title and the tab 107 $correspondingTabTitle.remove(); 108 $tab.remove(); 109 // Update the indices of the remaining tabs and tab titles 110 $('.et_pb_all_tabs .et_pb_tab, .et_pb_tabs_controls li').each(function(j, remainingElement) { 111 var $remainingElement = $(remainingElement); 112 $remainingElement.attr('class', function(i, classes) { 113 return classes.replace(/et_pb_tab_\d+_tb_body/, 'et_pb_tab_' + j + '_tb_body'); 114 }); 115 }); 116 // Since we've removed a tab, the indices are now off by one, so we need to decrease i by 1 to ensure we're checking the right tab in the next iteration 117 i--; 118 } 119 }); 120 121 var customSynopsisTabs = $('.custom_synopsis_tabs'); 122 123 customSynopsisTabs.each(function() { 124 var tabContainer = $(this); 125 var tabControls = tabContainer.find('.et_pb_tabs_controls li a'); 126 var tabContents = tabContainer.find('.et_pb_all_tabs .et_pb_tab'); 127 128 tabContainer.find('.et_pb_tabs_controls li:first').addClass('et_pb_tab_active'); 129 tabControls.on('click', function(event) { 130 event.preventDefault(); 131 var targetControlClass = $(this).data('control'); 132 133 // Update active tab control 134 tabControls.parent().removeClass('et-pb-active-slide'); 135 $(this).parent().addClass('et-pb-active-slide'); 136 137 // Update active tab content 138 tabContents.removeClass('et-pb-active-slide').filter('.' + targetControlClass).addClass('et-pb-active-slide'); 139 }); 140 }); 141 } 142 143 // if is single artist 144 if ( $('body').hasClass('single-artists')) { 145 146 // hide social profile divs that don't contain a link 147 $('.social-profile').each(function() { 148 if ($(this).find('a').length === 0) { 149 $(this).hide(); 150 } 151 }); 152 153 // if no social profiles, hide the social profiles text 154 if ($('.social-profile:visible').length === 0) { 155 $('.social-profiles-text').hide(); 156 } 157 158 // if letter is empty 159 if ($.trim($('.letter-content').text()) === '') { 160 $('.artist-letter').hide(); 161 } 162 } 163 164 function setup_collapsible_submenus() { 165 // mobile menu 166 $('.mobile_nav .menu-item-has-children > a').after('<span class="menu-closed"></span>'); 167 $('.mobile_nav .menu-item-has-children > a').each(function() { 168 $(this).next().next('.sub-menu').toggleClass('hide',1000); 169 }); 170 $('.mobile_nav .menu-item-has-children > a + span').on('click', function(event) { 171 event.preventDefault(); 172 $(this).toggleClass('menu-open'); 173 $(this).next('.sub-menu').toggleClass('hide',1000); 174 }); 175 } 176 $(window).load(function() { 177 setTimeout(function() { 178 setup_collapsible_submenus(); 179 }, 700); 180 }); 181 182 function checkWindowSize() { 183 var contactUsItem = $("#mobile_menu1").children(".contact-us"); 184 if ($(window).width() <= 980) { 185 if ($("#mobile_menu1").children(".custom-item").length === 0) { 186 contactUsItem.before('<li class="custom-item menu-item menu-item-type-post_type menu-item-object-page menu-item-2313"><a href="https://operasj.org/events">Calendar</a></li>'); 187 contactUsItem.before('<li class="custom-item menu-item menu-item-type-post_type menu-item-object-page menu-item-2313"><a href="https://secure.operasj.org/donate/q/donate-now" target="_blank">Donate</a></li>'); 188 } 189 } else { 190 $("#mobile_menu1").children(".custom-item").remove(); // remove the items if window width is more than 980 191 } 192 } 193 checkWindowSize(); 194 $(window).resize(function() { 195 checkWindowSize(); 196 }); 197 198 199});
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.