1( function( $ ) { 2 $(function() { 3 4 /** 5 * Remove Divi native mobile menu to prevent menu duplication. 6 * (remove ul.et_mobile_menu added by Divi) 7 * 8 * @since ??? 9 * @since v2.7.6 setTimeout used 10 */ 11 setTimeout(function(){ 12 $('#main-header #et_mobile_nav_menu .et_mobile_menu:not(.chimmc_mobile_menu)').remove(); 13 }, 0); 14 15 /** 16 * manage secondary menu items 17 */ 18 $(function() { 19 // get the value for secondary menu items position 20 var $chimmc_sec_menu_items_position = Chi_MMC_gen_options.chimmc_sec_menu_items_position; 21 22 if ( $( '#et-secondary-nav' ).length ) { 23 24 if ( $chimmc_sec_menu_items_position === 'before' ) { 25 26 // remove secondary menu items added to chimmc_mobile_menu by Divi 27 $('#main-header .chimmc_mobile_menu li.sec_menu_item').remove(); 28 29 if ($('.chimmc_mobile_menu li[id^="menu-item-"]').length){ 30 31 // insert before the first main menu item 32 $($( '#et-secondary-nav' ).clone().html()).insertBefore('#et-top-navigation .chimmc_mobile_menu > li[id^="menu-item-"]:first-of-type'); 33 34 } else if($('.chimmc_mobile_menu .et_pb_section').length) { 35 36 // insert before the first et_pb_section 37 $($( '#et-secondary-nav' ).clone().html()).insertBefore('#et-top-navigation .chimmc_mobile_menu .et_pb_section:first-of-type'); 38 39 } else { 40 41 // prepend secondary menu items to chimmc_mobile_menu 42 $('#et-top-navigation .chimmc_mobile_menu').prepend( $( '#et-secondary-nav' ).clone().html() ); 43 44 } 45 46 } else if ( $chimmc_sec_menu_items_position === 'after' ) { 47 48 // remove secondary menu items added to chimmc_mobile_menu by Divi 49 $('#main-header .chimmc_mobile_menu li.sec_menu_item').remove(); 50 51 if ($('.chimmc_mobile_menu li[id^="menu-item-"]').length){ 52 53 // insert after the last main menu item 54 $($( '#et-secondary-nav' ).clone().html()).insertAfter('#et-top-navigation .chimmc_mobile_menu > li[id^="menu-item-"]:last-of-type'); 55 56 } else if($('.chimmc_mobile_menu .et_pb_section').length) { 57 58 // insert after the last et_pb_section 59 $($( '#et-secondary-nav' ).clone().html()).insertAfter('#et-top-navigation .chimmc_mobile_menu .et_pb_section:last-of-type'); 60 61 } else { 62 63 // append secondary menu items to chimmc_mobile_menu 64 $('#et-top-navigation .chimmc_mobile_menu').append( $( '#et-secondary-nav' ).clone().html() ); 65 66 } 67 68 } else { 69 70 // remove secondary menu items added to chimmc_mobile_menu by Divi 71 $('#main-header .chimmc_mobile_menu li.sec_menu_item').remove(); 72 73 } 74 } 75 }); 76 77 // End 78 79 /** 80 * Add chi_mmc_activated css class 81 */ 82 $(function() { 83 $('#main-header').addClass('chi_mmc_activated'); 84 }); 85 86 // End 87 88 /** 89 * Add chi_mmc_fixed_menu css class 90 */ 91 92 $(function() { 93 94 var $chiMMCfixedMenu = Chi_MMC_gen_options.fixedMenu; 95 96 if( $chiMMCfixedMenu == 'fixed' ) { 97 $('body:not(.et_header_style_slide):not(.et_header_style_fullscreen).chi_dmm_styles .chi_mmc_activated #mobile_menu').addClass('chi_mmc_fixed_menu'); 98 } else { 99 $('body:not(.et_header_style_slide):not(.et_header_style_fullscreen).chi_dmm_styles .chi_mmc_activated #mobile_menu').removeClass('chi_mmc_fixed_menu'); 100 } 101 102 }); 103 104 // End 105 106 /** 107 * Collapse nested mobile menu submenu items 108 */ 109 110 function chi_dmm_collapse_submenus() { 111 112 // pulled value using wp_localize_script() 113 var $chiCollapseSubmenu = Chi_MMC_gen_options.collapseSubmenu; 114 115 if( $chiCollapseSubmenu == 1 ){ 116 117 $('.chi_dmm_styles .chi_mmc_activated #mobile_menu').addClass('chidmm_collapsable'); 118 119 // add class for making the parent menu item clickable 120 if($('body').hasClass('chimmc_parent_clickable')){ 121 122 $('.chi_dmm_styles #mobile_menu.chidmm_collapsable .menu-item-has-children').addClass('chimmc_clickable_parent'); 123 124 } 125 126 // append arrow to parent menu item 127 $('.chi_dmm_styles:not(.et_header_style_slide):not(.et_header_style_fullscreen) .chidmm_collapsable.et_mobile_menu li.menu-item-has-children > a').append('<span class="chimmc_mobile_menu_arrow"></span>'); 128 129 } else { 130 $('.chi_dmm_styles .chi_mmc_activated #mobile_menu').removeClass('chidmm_collapsable'); 131 132 // remove arrow from parent menu item 133 $('<span class="chimmc_mobile_menu_arrow"></span>').remove(); 134 135 } 136 137 var $menu = $('.chi_dmm_styles .chi_mmc_activated #mobile_menu.chidmm_collapsable'), 138 top_level_link = '.chi_dmm_styles .chi_mmc_activated #mobile_menu.chidmm_collapsable .menu-item-has-children > a'; 139 140 $menu.find('a').each(function() { 141 $(this).off('click'); 142 143 if ( $(this).is(top_level_link) ) { 144 145 if((/#/.test(this.href)) && $(this).attr('href').length == 1){ 146 147 $(this).parent().removeClass('chimmc_clickable_parent'); 148 149 $(this).attr('href', '#').off('click'); 150 151 } else { 152 153 if ($(this).parent().hasClass('chimmc_clickable_parent')) { 154 $('<a class="chimmc_clickable_link"></a>').attr('href', $(this).attr('href')).on('click', function(e){ e.stopPropagation(); }).appendTo($(this)); 155 } 156 157 $(this).attr('href', '#'); 158 159 } 160 } 161 162 if ( ! $(this).siblings('.sub-menu').length ) { 163 $(this).on('click', function(event) { 164 $(this).parents('.mobile_nav').trigger('click'); 165 }); 166 } else { 167 168 $(this).on('click', function(event) { 169 event.preventDefault(); 170 171 var this_parent_siblings = $(this).parent().siblings('li.menu-item-has-children'); 172 173 // if submenu accordion is enabled 174 if ($('body').hasClass('chimmc_toggle_submenus')){ 175 // close other opened submenus of the same submenu level if a new one is opened 176 this_parent_siblings.removeClass('visible').addClass('hidden_sub'); 177 } 178 179 // toggle current submenu 180 $(this).parent().removeClass('hidden_sub').toggleClass('visible'); 181 182 }); 183 } 184 }); 185 } 186 187 $(function() { 188 chi_dmm_collapse_submenus(); 189 }); 190 191 // End Collapse nested mobile menu submenu items 192 193 /* 194 * Menu custom animations 195 */ 196 197 // pulled value using wp_localize_script() 198 var $chiCustomInAnimation = Chi_MMC_gen_options.customInAnimation; 199 var $chiCustomOutAnimation = Chi_MMC_gen_options.customOutAnimation; 200 201 $(function() { 202 203 if ( $('body:not(.et_header_style_slide):not(.et_header_style_fullscreen)').hasClass('et_header_style_left') || $('body').hasClass('et_header_style_centered') || $('body').hasClass('et_header_style_split') ){ 204 205 var $this_menu = $('#main-header .mobile_nav'); 206 var $dropdown_nav = $('#main-header .et_mobile_menu'); 207 208 $this_menu.off('click'); 209 210 // the mobile menu hamburger icon click 211 $this_menu.find('.mobile_menu_bar').on( 'click', function(e){ 212 213 if ( $this_menu.hasClass('closed') ){ 214 $this_menu.removeClass( 'closed' ).addClass( 'opened' ); 215 216 if ($chiCustomInAnimation != 'default') { 217 // remove default slideDown effect 218 $dropdown_nav.stop(true, true); 219 } else { 220 // add slideDown effect 221 $('.chi_mmc_activated .mobile_nav.opened .et_mobile_menu').slideDown(500); 222 } 223 224 // keep the menu visible while animation runs 225 $('.chi_mmc_activated .mobile_nav.opened .et_mobile_menu').css( { 'display' : 'block' } ); 226 227 228 } else if ( $this_menu.hasClass('opened') ) { 229 230 $this_menu.removeClass( 'opened' ).addClass( 'closed' ); 231 232 if ( $chiCustomOutAnimation != 'default' ){ 233 // remove default slideUp effect 234 $dropdown_nav.stop(true, true); 235 } else { 236 // add slideUp effect 237 $('.chi_mmc_activated .mobile_nav.closed .et_mobile_menu').slideUp(500); 238 } 239 240 // hide the menu after css animation completed 241 if ( $chiCustomOutAnimation == 'none' ){ 242 243 setTimeout( function() { 244 // fix for menu disappearing due to animation delay despite having class 'opened' 245 $this_menu.removeClass( 'opened' ).addClass( 'closed' ); 246 // hide menu without delay for 'none' value 247 $dropdown_nav.css( { 'display' : 'none' } ); 248 }, 0 ); 249 } else { 250 setTimeout( function() { 251 // fix for menu disappearing due to animation delay despite having class 'opened' 252 $this_menu.removeClass( 'opened' ).addClass( 'closed' ); 253 // hide menu with a delay 254 $dropdown_nav.css( { 'display' : 'none' } ); 255 }, 700 ); 256 } 257 } 258 return false;
259 } ); 260 } 261 }); 262 // End menu custom animations 263 264 /* 265 * Anchor scroll fix for fixed mobile menu 266 */ 267 268 $(function() { 269 $(window).on("load resize", function() { 270 271 if ( $('body:not(.et_header_style_slide):not(.et_header_style_fullscreen)').hasClass('et_header_style_left') || $('body').hasClass('et_header_style_centered') || $('body').hasClass('et_header_style_split') && $('.chi_mmc_activated .et_mobile_menu').hasClass('chi_mmc_fixed_menu')) { 272 273 // Mobile menu dropdown 274 var $dropdown_nav = $('#main-header .et_mobile_menu'); 275 276 $( 'body:not(.et_header_style_slide):not(.et_header_style_fullscreen) .chi_mmc_activated #mobile_menu.chi_mmc_fixed_menu a[href*="#"]:not([href="#"])' ).on("click", function() { 277 278 $(this).parents( '.chi_mmc_activated .mobile_nav' ).removeClass( 'opened' ).addClass( 'closed' ); 279 280 if ( $chiCustomOutAnimation == 'default' ){ 281 // add slideUp effect 282 $('.chi_mmc_activated .mobile_nav.closed .et_mobile_menu').slideUp(500); 283 } 284 285 // hide the menu after css animation completed 286 if ( $chiCustomOutAnimation == 'none' ){ 287 setTimeout( function() { 288 // hide menu without delay for 'none' value 289 $dropdown_nav.css( { 'display' : 'none' } ); 290 }, 0 ); 291 } else { 292 setTimeout( function() { 293 // hide menu with a delay 294 $dropdown_nav.css( { 'display' : 'none' } ); 295 }, 700 ); 296 } 297 298 var $this_link = $( this ), 299 has_closest_smooth_scroll_disabled = $this_link.closest( '.et_smooth_scroll_disabled' ).length, 300 has_closest_woocommerce_tabs = ( $this_link.closest( '.woocommerce-tabs' ).length && $this_link.closest( '.tabs' ).length ), 301 has_closest_eab_cal_link = $this_link.closest( '.eab-shortcode_calendar-navigation-link' ).length, 302 has_acomment_reply = $this_link.hasClass( 'acomment-reply' ), 303 disable_scroll = has_closest_smooth_scroll_disabled || has_closest_woocommerce_tabs || has_closest_eab_cal_link || has_acomment_reply; 304 305 var topHeaderHeight = $( '#top-header' ).length > 0 ? parseInt( $( '#top-header' ).outerHeight() ) : 0; 306 var mainHeaderHeight = $( '#main-header' ).length > 0 ? parseInt( $( '#main-header' ).outerHeight() ) : 0; 307 var adminBarHeight = $( '#wpadminbar' ).length > 0 ? parseInt( $( '#wpadminbar' ).outerHeight() ) : 0; 308 var offset = parseInt(adminBarHeight) + parseInt(topHeaderHeight) + parseInt(mainHeaderHeight) ; 309 310 if ( ( location.pathname.replace( /^\//,'' ) == this.pathname.replace( /^\//,'' ) && location.hostname == this.hostname ) && ! disable_scroll ) { 311 var target = $( this.hash ); 312 313 target = target.length ? target : $( '[name=' + this.hash.slice(1) +']' ); 314 315 /** 316 * Get the anchor from the url (eg. '#home'). 317 * @since v2.7.7 318 */ 319 let _url = $(this).attr("href"), 320 _hash = _url.substring(_url.indexOf("#")); 321 322 if ( target.length ) { 323 $("html, body").animate({ 324 scrollTop: $( _hash ).offset().top - offset 325 }, 1000); 326 327 // Prevent the jump/flash 328 return false;
329 } 330 } 331 }); 332 } 333 }); /* on: load resize */ 334 }); 335 336 // End anchor scroll fix for fixed mobile menu 337 338 // SINCE V1.3.2 339 340 /* 341 * Fix for vertical nav bar and non-fixed nav main content top offsets 342 */ 343 $(function() { 344 345 $(window).on("load resize", function (e) { 346 chimmc_fix_header_and_content_position(); 347 }); 348 349 function chimmc_fix_header_and_content_position(){ 350 351 var default_centered_split_headers = 'body:not(.et_header_style_slide):not(.et_header_style_fullscreen).chi_dmm_styles.et_header_style_left, body.chi_dmm_styles.et_header_style_centered, body.chi_dmm_styles.et_header_style_split'; 352 353 if( $( default_centered_split_headers ).hasClass( 'et_vertical_nav' ) && $('#et_mobile_nav_menu').is(':visible') ) { 354 355 var adminBarHeight = $( '#wpadminbar' ).length > 0 ? parseInt( $( '#wpadminbar' ).outerHeight() ) : 0; 356 var topHeaderHeight = $( '#top-header' ).length > 0 ? parseInt( $( '#top-header' ).outerHeight() ) : 0; 357 var mainHeaderHeight = $( '#main-header' ).length > 0 ? parseInt( $( '#main-header' ).outerHeight() ) : 0; 358 var offset = adminBarHeight + topHeaderHeight + mainHeaderHeight; 359 360 $('#main-header.chi_mmc_activated').css( 'top' , adminBarHeight + topHeaderHeight ); 361 $( '#main-content' ).css( 'padding-top', offset ); 362 363 } else if ( $( default_centered_split_headers ).hasClass( 'et_vertical_nav' ) && ! $('#et_mobile_nav_menu').is(':visible') ) { 364 365 $('#main-header.chi_mmc_activated').css( 'top' , 0 ); 366 $( '#main-content' ).css( 'padding-top', 0 ); 367 368 } else if ( $( default_centered_split_headers ) ) { 369 370 $( '#main-content' ).css( 'padding-top', 0 ); 371 372 } 373 374 // fix main content padding top issue for non-fixed nav (v2.0.4) 375 376 if( $( default_centered_split_headers ).hasClass( 'et_non_fixed_nav' ) && ! $( default_centered_split_headers ).hasClass( 'et_transparent_nav' ) && $('#et_mobile_nav_menu').is(':visible') ) { 377 378 // var adminBarHeight = $( '#wpadminbar' ).length > 0 ? parseInt( $( '#wpadminbar' ).outerHeight() ) : 0; 379 var topHeaderHeight = $( '#top-header' ).length > 0 ? parseInt( $( '#top-header' ).outerHeight() ) : 0; 380 var mainHeaderHeight = $( '#main-header' ).length > 0 ? parseInt( $( '#main-header' ).outerHeight() ) : 0; 381 var offset = topHeaderHeight + mainHeaderHeight ; 382 383 $( '#main-content' ).css( { paddingTop: offset } ); 384 385 } 386 387 // end fix main content padding top issue for non-fixed nav 388 } 389 }); 390 // End fix for vertical nav bar and non-fixed nav main content top offsets 391 392 /** 393 * fix main header top offset (since v2.0.2) 394 */ 395 function chimmc_update_styles( style_id, $style_content ) { 396 if ( $( style_id ).length ) { 397 if ( '' !== $style_content ) { 398 $( style_id ).replaceWith( $style_content ); 399 } else { 400 $( style_id ).remove(); 401 } 402 } else { 403 $( 'head' ).append( $style_content ); 404 } 405 } 406 407 $(function() { 408 function main_header_top_offset( value ) { 409 410 // fix for pre-header layout injected using the Divi Layout Injector plugin 411 // v2.0.5 412 if ( $( 'body' ).hasClass( 'et_non_fixed_nav' ) && $("#main-header:not(.sticky-element-cloned)").prev('.et_pb_section').hasClass('sb_dli_pre_header') && !$( '#main-header #mobile_menu' ).hasClass( 'chi_mmc_fixed_menu' ) ) { 413 offset_value = 0; 414 header_position = 'body.chi_dmm_styles #main-header.chi_mmc_activated, body.chi_dmm_styles #top-header { position: relative !important;} body.chi_dmm_styles.et_non_fixed_nav #main-content { padding-top: 0px !important; }'; 415 } else { 416 offset_value = value; 417 header_position = ''; 418 } 419 420 // end Divi Layout Injector fix 421 var $style_content = '<style id="main_header_top_offset">@media all and (max-width: 980px){ body:not(.divibar-open):not(.et_header_style_slide):not(.et_header_style_fullscreen).chi_dmm_styles.et_header_style_left #main-header, body.chi_dmm_styles.et_header_style_centered #main-header, body.chi_dmm_styles.et_header_style_split #main-header {top: ' + offset_value + 'px !important;} ' + header_position + ' } </style>', 422 style_id = 'style#main_header_top_offset'; 423 424 chimmc_update_styles( style_id, $style_content ); 425 } 426 427 $(window).on("load resize", function (e) { 428 429 var chiScreenWidth = parseInt( $(window).width() ); 430 431 if ( chiScreenWidth < 981 ){ 432 433 var adminBarHeight = $( '#wpadminbar' ).length > 0 ? parseInt( $( '#wpadminbar' ).outerHeight() ) : 0; 434 var topHeaderHeight = $( '#top-header' ).length > 0 ? parseInt( $( '#top-header' ).outerHeight() ) : 0; 435 var header_top_offset = adminBarHeight + topHeaderHeight; 436 437 main_header_top_offset( header_top_offset ); 438 439 } 440 }); 441 }); 442 443 // End fix for main header top offset 444 445 /** 446 * prevent menu icons from being applied to Menu Module menu items 447 */ 448 $(function() { 449 $('.et_pb_module.et_pb_fullwidth_menu ul.et_mobile_menu li, .et_pb_module.et_pb_menu ul.et_mobile_menu li').each( function(){ 450 if ( $(this).hasClass( 'chimmc-has-icon' ) ) { 451 $(this).removeClass( 'chimmc-has-icon' ); 452 } 453 }); 454 }); 455 456 // End fix for Menu Module 457 458 $(function() { 459 460 /** 461 * append search icon 462 */ 463 $(window).on("load resize", function (e) { 464 chimmc_show_search_icon(); 465 }); 466 467 // pulled value using wp_localize_script() 468 // mmc plugin show search icon option 469 var $chiShowSearchIcon = Chi_MMC_gen_options.showSearchIcon; 470 // divi core show search icon option 471 var $etShowSearchIcon = Chi_MMC_gen_options.etShowSearchIcon; 472 473 function chimmc_show_search_icon(){ 474 if ( $('#et_mobile_nav_menu').is(':visible') && ! $( '#et_top_search' ).length && 1 == $chiShowSearchIcon ){ 475 $( '#top-menu-nav' ).after( '<div id="et_top_search" class="chimmc_top_search"><span id="et_search_icon"></span></div>' ); 476 } 477 } 478 479 // end appending search icon 480 // delegate click event to #et_top_search to make sure click works for appended #et_top_search too 481 $( '#et-top-navigation' ).on( 'click', '#et_top_search', function() { 482 var $search_container = $( '.et_search_form_container' ); 483 484 if ( $search_container.hasClass('et_pb_is_animating') ) { 485 return; 486 } 487 488 $( '.et_menu_container' ).removeClass( 'et_pb_menu_visible et_pb_no_animation' ).addClass('et_pb_menu_hidden'); 489 $search_container.removeClass( 'et_pb_search_form_hidden et_pb_no_animation' ).addClass('et_pb_search_visible et_pb_is_animating'); 490 491 setTimeout( function() { 492 $( '.et_menu_container' ).addClass( 'et_pb_no_animation' ); 493 $search_container.addClass( 'et_pb_no_animation' ).removeClass('et_pb_is_animating'); 494 }, 1000); 495
496 $search_container.find( 'input' ).focus(); 497 498 et_set_search_form_css(); 499 }); 500 501 // copy of et_set_search_form_css() function taken from custom.js file 502 function et_set_search_form_css() { 503 504 var $search_container = $( '.et_search_form_container' ); 505 var $body = $( 'body' ); 506 507 if ( $search_container.hasClass( 'et_pb_search_visible' ) ) { 508 509 var header_height = $( '#main-header' ).innerHeight(), 510 menu_width = $( '#top-menu' ).width(), 511 font_size = $( '#top-menu li a' ).css( 'font-size' ); 512 $search_container.css( { 'height' : header_height + 'px' } ); 513 $search_container.find( 'input' ).css( 'font-size', font_size ); 514 515 if ( ! $body.hasClass( 'et_header_style_left' ) ) { 516 $search_container.css( 'max-width', menu_width + 60 ); 517 } else { 518 $search_container.find( 'form' ).css( 'max-width', menu_width + 60 ); 519 } 520 } 521 } 522 523 /** 524 * calculate right offset for search icon on Centered and Split headers 525 */ 526 527 $(window).on("load resize", function (e) { 528 chimmc_search_icon_right_offset(); 529 }); 530 531 function chimmc_search_icon_right_offset(){ 532 533 if ( ! $( 'body' ).hasClass( 'et_header_style_left' ) && $('#et_mobile_nav_menu').is(':visible') ) { 534 535 // Clone #main-header 536 $( '#main-header' ).clone().addClass( 'main_header-clone' ).css({ top : 'auto', bottom : 0, 'opacity' : 0 }).appendTo( $('body') ); 537 538 // get width of cloned #main-header's .mobile_menu_bar when dropdown menu is closed 539 closed_mobile_menu_bar_width = $( '.main_header-clone .mobile_nav.closed .mobile_menu_bar' ).width(); 540 541 closed_mobile_menu_bar_width = parseInt( closed_mobile_menu_bar_width ); 542 543 // "open" dropdown menu of cloned header 544 $( ".main_header-clone .mobile_nav" ).removeClass( 'closed' ).addClass( 'opened' ); 545 546 // get width of cloned #main-header's .mobile_menu_bar when dropdown menu is opened 547 opened_mobile_menu_bar_width = $( '.main_header-clone .mobile_nav.opened .mobile_menu_bar' ).width(); 548 549 opened_mobile_menu_bar_width = parseInt( opened_mobile_menu_bar_width ); 550 551 setTimeout( function(){ 552 // remove cloned #main-header 553 $('.main_header-clone').remove(); 554 }, 1000 ); 555 556 // set initial right offset for search icon 557 $( '#main-header #et_top_search' ).css({'right' : closed_mobile_menu_bar_width }); 558 559 // toggle search icon right offset for opened and closed menu 560 $( ".mobile_menu_bar" ).on("click", function() { 561 562 if ( $( '#main-header .mobile_nav' ).hasClass('closed') && $('#et_mobile_nav_menu').is(':visible') ) { 563 // set right offset for closed menu 564 $( '#main-header #et_top_search' ).css({'right' : opened_mobile_menu_bar_width }); 565 } else if ( $( '#main-header .mobile_nav' ).hasClass('opened') && $('#et_mobile_nav_menu').is(':visible') ) { 566 // set right offset for opened menu 567 $( '#main-header #et_top_search' ).css({'right' : closed_mobile_menu_bar_width }); 568 } 569 }); 570 571 } else { 572 // unset search icon right offset 573 $( '#main-header #et_top_search' ).css({'right' : "" }); 574 } 575 576 // remove additional logo contaiers created on resize 577 $('#main-header .centered-inline-logo-wrap .logo_container').not(':first').remove(); 578 $('#main-header .et_menu_container .logo_container').not(':first').remove(); 579 } 580 581 // end calculation of right offset for search icon on Centered and Split headers 582 583 /** 584 * adjust search form vertical positioning 585 */ 586 // execute on screen resizing and scrolling 587 $(window).on("resize scroll", function (e) { 588 chimmc_search_form_position(); 589 }); 590 // execute on search icon click or tap 591 $( "#et-top-navigation" ).on("click tap", '#et_top_search', function (e) { 592 chimmc_search_form_position(); 593 }); 594 595 function chimmc_search_form_position(){ 596 597 if ( ! $( 'body' ).hasClass( 'et_header_style_left' ) && $('#et_mobile_nav_menu').is(':visible') ) { 598
599 // calculate #et-top-navigation top position and add #main-header's padding-top to it 600 var search_form_top_offset = parseInt( $( '#et-top-navigation' ).position().top ) + 20; 601 602 // adjust vertical positioning of search form and its container 603 $( '.container.et_search_form_container.et_pb_search_visible' ).css({ paddingTop : search_form_top_offset }); 604 $( '.et_pb_search_visible .et-search-form' ).css({ 'top' : search_form_top_offset }); 605 606 } else { 607 608 // adjust vertical positioning of search form and its container 609 $( '.container.et_search_form_container' ).css({ paddingTop : "" , 'max-width' : "" }); 610 $( '.et-search-form' ).css({ 'top' : "" }); 611 612 } 613 } 614 // end adjusting search form vertical positioning 615 616 }); 617 618 // End calculation of right offset for search icon on Centered and Split headers 619 620 }); 621 622} )( jQuery );
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.