1var Codevz = ( function( $ ) { 2 "use strict"; 3 4 var wind = $( window ), 5 body = $( document.body ), 6 page = $( 'html, body' ), 7 inla = $( '.inner_layout' ).length ? $( '.inner_layout' ) : body; 8 9 // Remove no-js class. 10 document.documentElement.classList.remove("no-js"); 11 12 // Custom easing. 13 $.extend( $.easing, { 14 def: 'easeInOutCodevz', 15 easeInOutCodevz: function(x) { 16 return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? Math.pow( 2, 20 * x - 10 ) / 2 : ( 2 - Math.pow( 2, -20 * x + 10 ) ) / 2; 17 } 18 }); 19 20 // Codevz callback. 21 if ( ! $.fn.codevz ) { 22 23 $.fn.codevz = function( data, callback ) { 24 25 if ( $( this ).length ) { 26 27 var $this = $( this ), 28 run = function( e ) { 29 30 var l = e.length, i = 0; 31 32 for( i; i < l; i++ ) { 33 34 var x = $( e[i] ); 35 36 if ( x.data( 'codevz' ) !== data ) { 37 callback.apply( x.data( 'codevz', data ), [ x, i ] ); 38 } 39 40 } 41 42 }; 43 44 if ( Codevz.inview( $this, 100 ) ) { 45 46 run( $this ); 47 48 } else { 49 50 $( window ).on( 'scroll.codevz', function() { 51 52 run( $this ); 53 54 $( this ).off( 'scroll.codevz' ); 55 56 } ); 57 58 } 59 60 } 61 62 } 63 64 } 65 66 return { 67 68 inview: function( e, offset ) { 69 70 var offset = offset || 0, 71 docViewTop = wind.scrollTop(), 72 docViewBottom = docViewTop + wind.height(), 73 elemTop = e.offset().top, 74 elemBottom = elemTop + e.height(); 75 76 return ( ( elemTop <= docViewBottom + offset ) && ( elemBottom >= docViewTop - offset ) ); 77 78 }, 79 80 init: function() { 81 82 // Header custom shape size. 83 document.querySelectorAll('div[class*="cz_row_shape_"]').forEach(x => { 84 window.Codevz.heightChanged(x, () => { 85 const cls = '.' + Array.from(x.classList).join('.'); 86 const hei = x.offsetHeight + 37; 87 88 let style = x.querySelector(':scope > style'); 89 if (!style) { 90 style = document.createElement('style'); 91 x.appendChild(style); 92 } 93 94 style.textContent = cls + ' .row:before,' + cls + ' .row:after{width:' + hei + 'px}.elms_row ' + cls + ':before, .elms_row ' + cls + ':after{width:' + hei + 'px}'; 95 }); 96 }); 97 98 // Social Dorpdown. 99 body.off( 'click.social_trigger' ).on( 'click.social_trigger', '.xtra-social-icon-trigger', function() { 100 101 var x = $( this ), 102 box = x.next( '.xtra-social-dropdown' ); 103 104 if ( box.length ) { 105 106 if ( box.is( ':visible' ) ) { 107 box.fadeOut( 'fast' ); 108 } else { 109 box.fadeIn( 'fast' ); 110 } 111 112 } 113 114 }).on( 'click', function( e ) { 115 116 if ( $( e.target ).closest( '.cz_elm' ).length ) { 117 return; 118 } 119 120 $( '.xtra-social-dropdown' ).fadeOut( 'fast' ); 121 122 }); 123 124 // Alignfull & Videos 125 const els = document.querySelectorAll('.alignfull, .cz_iframe, .content iframe, object, embed:not(.wp-embedded-content)'); 126 const obs = new ResizeObserver(() => requestAnimationFrame(() => { 127 const winW = window.innerWidth; 128 els.forEach(el => { 129 const pW = el.parentElement.offsetWidth; 130 if (el.classList.contains('alignfull')) { 131 Object.assign(el.style, { width: winW + 'px', left: (pW - winW) / 2 + 'px' }); 132 } else { 133 const r = el.dataset.ratio ||= el.offsetHeight / el.offsetWidth; 134 Object.assign(el.style, { width: pW + 'px', height: pW * r + 'px' }); 135 } 136 }); 137 })); 138 obs.observe(document.documentElement); 139 140 // Posts equality. 141 document.querySelectorAll( '.cz_posts_container' ).forEach( el => { 142 if ( el.querySelector( '.cz_default_loop_grid' ) ) { 143 el.classList.add( 'cz_posts_equal' ); 144 } 145 }); 146 147 // Widget nav menu dropdown. 148 document.querySelectorAll( '.widget_nav_menu .menu-item-has-children > a' ).forEach( el => { 149 if ( ! el.querySelector( '.fa-angle-down' ) ) { 150 el.insertAdjacentHTML( 'beforeend', '<i class="fa fa-angle-down" aria-hidden="true"></i>' ); 151 } 152 }); 153 154 // Widget nav menu dropdown arrow. 155 body.on( 'click', '.widget_nav_menu .menu-item-has-children > a > i', function( e ) { 156 157 $( this ).toggleClass( 'fa-angle-down fa-angle-up' ).closest( 'li' ).find( '> ul' ).slideToggle(); 158 159 e.preventDefault(); 160 161 // Dropdown menu off screen. 162 }).on( 'mouseenter', '.sf-menu .menu-item-has-children', function() { 163 164 var dropdown = $( this ).find( '> ul' ).removeClass( 'cz_open_menu_reverse' ), 165 isVisible = dropdown.offset().left + dropdown.width() <= inla.width(); 166 167 dropdown[ isVisible ? 'removeClass' : 'addClass' ]( 'cz_open_menu_reverse' ); 168 169 }); 170 171 // Menus 172 $( '.sf-menu' ).each( function( i ) { 173 174 var x = $( this ), 175 overlay = $( '.codevz-plus-dropdown-overlay .inner_layout > .cz_overlay' ), 176 indicator = x.data( 'indicator' ) || ( x.hasClass( 'offcanvas_menu' ) ? 'fa fa-angle-down' : '' ), 177 indicator2 = x.data( 'indicator2' ) || ( x.hasClass( 'offcanvas_menu' ) ? 'fa fa-angle-down' : '' ), 178 overlayTimeout; 179 180 // Superfish. 181 x.codevzMenu({ 182 183 onInit: function() { 184 185 // Menu indicators. 186 $( '.sub-menu', this ).parent().each( function() { 187 188 var en = $( this ), 189 a = en.find( '> a, > .codevz-plus-megamenu-title' ); 190 191 if ( ! a.find( '.cz_indicator' ).length ) { 192 193 if ( $( '.cz_menu_subtitle', a ).length ) { 194 $( '.cz_menu_subtitle', a ).before( '<i class="cz_indicator" aria-hidden="true"></i>' ); 195 } else { 196 a.append( '<i class="cz_indicator" aria-hidden="true"></i>' ); 197 } 198 199 } 200 201 if ( indicator || indicator2 ) { 202 $( '.cz_indicator', a ).addClass( a.closest( '.sub-menu' ).length ? indicator2 : indicator ); 203 } 204 205 if ( en.html() === '' ) { 206 en.find( '.cz_indicator' ).remove(); 207 en.next( 'ul' ).remove(); 208 } 209 210 // Empty href. 211 !en.attr( 'href' ) && en.removeClass( 'current_menu' ); 212 213 // Fix: Current active menu in dropdown. 214 en.find( '.current_menu' ).length && setTimeout(function() { 215 en.addClass( 'current_menu' ); 216 }, 250 ); 217 218 }); 219 220 // Fix: Keep original current menu in dropdown menu. 221 if ( x.find( '.current_menu ul > .current-menu-item' ).length ) { 222 223 x.find( '.current_menu ul > .current-menu-item' ).siblings().removeClass( 'current_menu' ); 224 225 // If there is no current menu but ancestor exists. 226 } else if ( ! x.find( '.current_menu' ).length && x.find( '.current-page-ancestor, .current-post-ancestor, .current-menu-item' ).length ) { 227 228 $( x.find( '.current-page-ancestor, .current-post-ancestor, .current-menu-item' )[0] ).addClass( 'current_menu' ); 229 230 } 231 232 // Auto responsive menu items according to window width. 233 if ( x.not( '#menu_header_4, #menu_fixed_side_1, .cz-not-three-dots' ).length ) { 234 235 // Fix single menu in column issue. 236 if ( x.parent().parent().find( '.cz_elm' ).length == 1 ) { 237 x.parent().parent().append( '<div class="cz_elm"> </div>' ); 238 } 239 240 wind.on( 'resize.responsive', function() { 241 242 var en = x, 243 parent = en.parent(), 244 elementor = en.closest( '.elementor-container' ), 245 menu_margin = parseFloat( parent.css( 'margin-left' ) ) + parseFloat( parent.css( 'margin-right' ) ), 246 elements = 0, 247 container, 248 three_dots = ( body.attr( 'class' ).indexOf( 'codevz-plus' ) >= 0 ) ? '<i class="fa czico-055-three cz-extra-menus" style="margin:0" aria-hidden="true"></i>' : '...'; 249 250 setTimeout( function() { 251 252 // Reset 253 en.append( en.find( '.cz-extra-menus > .sub-menu > li' ) ).find( '.cz-extra-menus' ).remove(); 254 255 // Add icon dots 256 if ( ! en.find( '.cz-extra-menus' ).length ) { 257 var submenu_title = $( '.cz_menu_subtitle' ).text() ? '<span class="cz_menu_subtitle"> </span>' : ''; 258 en.append( '<li class="cz-extra-menus cz"><a href="#" class="sf-with-ul" role="button" tabindex="0" aria-label="More hidden menu links" aria-hidden="true"><span> ' + three_dots + ' </span>' + submenu_title + '</a><ul class="sub-menu" aria-hidden="true"></ul></li>'); 259 } 260 261 var nw = en.find( '.cz-extra-menus' ), 262 nw_ul = nw.find( '> ul' ); 263 264 nw.hide().prev().addClass( 'cz-last-child' ); 265 266 // Get elements width 267 en.parent().parent().find( '.cz_elm' ).not( parent ).each(function() { 268 269 elements += $( this ).outerWidth() + parseFloat( $( this ).css( 'margin-left' ) ) + parseFloat( $( this ).css( 'margin-right' ) ); 270 271 }); 272 273 // Move back to parent 274 nw_ul.find( '> li' ).appendTo( en ); 275 276 // Move to hidden menu 277 $( en.find( '> li' ).not( '.cz-extra-menus' ).get().reverse() ).each( function() { 278 279 if ( elementor.length ) { 280 container = elementor.outerWidth(); 281 } else { 282 container = en.closest( '.have_center' ).length ? parent.parent().parent().outerWidth() : parent.parent().outerWidth(); 283 } 284 285 if ( ( parent.outerWidth() + menu_margin ) + elements + ( elementor ? 0 : 25 ) > container ) { 286 $( this ).prependTo( nw_ul ); 287 nw.show(); 288 } 289 290 }); 291 292 }, 1000 ); 293 294 }).trigger( 'resize.responsive' ); 295 296 } 297 298 }, 299 onBeforeHide: function() { 300 301 var x = $( this ); 302 303 clearTimeout( overlayTimeout ); 304 305 // Hide overlay background. 306 overlayTimeout = setTimeout( function() { 307 if ( ! $( '.sfHover' ).length ) { 308 overlay.fadeOut(); 309 } 310 }, 50 ); 311 312 }, 313 onBeforeShow: function() { 314 315 var x = $( this ); 316 317 setTimeout( function() { 318 319 // Sub menu. 320 if ( x.hasClass( 'sub-menu' ) ) { 321 322 overlay.css( 'z-index', '99' ).fadeIn(); 323 324 // Check if mega menu is fullwide 325 if ( x.parent().hasClass( 'cz_megamenu_width_fullwide' ) ) { 326 327 var megamenu_row = body, 328 megamenu_row_offset = megamenu_row.offset().left, 329 megamenu_row_width = megamenu_row.width(); 330 331 x.attr( 'style', x.attr( 'style' ) + 'width: ' + wind.width() + 'px;left:' + ( megamenu_row_offset - x.parent().offset().left ) + 'px;margin-right:0;margin-left:0;right:auto !important;' ); 332 333 } 334 335 // Sub-menu styling 336 if ( x.parent().data( 'sub-menu' ) ) { 337 setTimeout(function() { 338 x.attr( 'style', x.attr( 'style' ) + x.parent().data( 'sub-menu' ) ); 339 }, 50 ); 340 } 341 342 // Megamenu 343 if ( x.parent().hasClass( 'cz_parent_megamenu' ) ) { 344 x.addClass( 'cz_megamenu_' + $( '> .cz', x ).length ).find( 'ul' ).addClass( 'cz_megamenu_inner_ul clr' ); 345 } 346 347 // Megamenu full row 348 if ( x.parent().hasClass( 'cz_megamenu_width_full_row' ) ) { 349 350 var megamenu_row = $( '.row' ), 351 megamenu_row_offset = megamenu_row.offset().left, 352 megamenu_row_width = megamenu_row.width(); 353 354 if ( x.closest( '.cz-extra-menus' ).length ) { 355 356 megamenu_row_width = megamenu_row_width - ( megamenu_row.width() - x.parent().offset().left + 10 ); 357 358 } 359 360 x.attr( 'style', x.attr( 'style' ) + 'width: ' + megamenu_row_width + 'px;left:' + ( megamenu_row_offset - x.parent().offset().left ) + 'px;' ); 361 362 } 363 364 } 365 366 if ( x.closest('.fixed_side').length ) { 367 var pwidth = x.parent().closest( '.sub-menu' ).length ? '.sub-menu' : '.sf-menu', 368 ff_pos = $( '.fixed_side' ).hasClass( 'fixed_side_left' ) ? 'left' : 'right'; 369 x.css( ff_pos, x.closest( pwidth ).width() ); 370 } 371 372 }, 100 ); 373 374 setTimeout( function() { 375 376 // Fix grid & carousel. 377 if ( x.parent().hasClass( 'cz_parent_megamenu' ) ) { 378 wind.trigger( 'resize' ).trigger( 'scroll' ); 379 } 380 381 }, 250 ); 382 383 } 384 385 }); 386 387 }); 388 389 // Prevent empty ul links click. 390 body.on( 'click', '.sf-with-ul', function( e ) { 391 392 if ( this.getAttribute('href') === '#' ) { 393 e.preventDefault(); 394 e.stopPropagation(); 395 } 396 397 // Dropdown Menu 398 }).off( 'click.icon_dropdown_menu' ).on( 'click.icon_dropdown_menu', '.icon_dropdown_menu', function( e ) { 399 400 var x = $( this ), 401 pos = x.position(), 402 nav = x.parent().find('.sf-menu'),
403 row = $( this ).closest('.row').height(), 404 offset = ( ( inla.outerWidth() + inla.offset().left ) - x.offset().left ); 405 406 nav.fadeToggle( 'fast' ); 407 x.toggleClass( 'czico-close' ); 408 409 $( '.cz', nav ).on( 'mouseenter mouseleave', function(e) { 410 e.stopPropagation(); 411 }).off( 'click' ).on( 'click', function(e) { 412 if ( $( e.target ).hasClass( 'cz_indicator' ) ) { 413 $( this ).closest( 'li' ).find('> ul').fadeToggle( 'fast' ); 414 x.toggleClass( 'czico-close' ); 415 e.preventDefault(); 416 e.stopPropagation(); 417 } 418 }); 419 420 e.stopPropagation(); 421 422 // Open Menu Horizontal 423 }).off( 'click.icon_open_horizontal' ).on( 'click', '.icon_open_horizontal', function( e ) { 424 425 var x = $( this ), 426 pos = x.position(), 427 nav = x.parent().find('.sf-menu'), 428 row = $( this ).closest('.row').height(), 429 offset = ( ( inla.outerWidth() + inla.offset().left ) - x.offset().left ); 430 431 nav.fadeToggle( 'fast' ); 432 x.toggleClass( 'czico-close' ); 433 434 e.stopPropagation(); 435 436 // Mobile Menu 437 }).off( 'click.icon_mobile_offcanvas_menu' ).on( 'click', 'i.icon_mobile_offcanvas_menu', function() { 438 439 var x = $( this ); 440 441 if ( ! x.hasClass( 'done' ) ) { 442 443 setTimeout( function() { 444 445 Codevz.offCanvas( x.addClass( 'done' ), 1 ); 446 447 var ul_offcanvas = $( 'ul.offcanvas_area' ), 448 indicator = ul_offcanvas.data( 'indicator' ), 449 default_ind = ul_offcanvas.hasClass( 'offcanvas_menu' ) ? 'fa fa-angle-down' : '', 450 indicator = indicator ? indicator : default_ind, 451 indicator2 = ul_offcanvas.data( 'indicator2' ), 452 indicator2 = indicator2 ? indicator2 : default_ind, 453 header = x.parent().find( '.xtra-mobile-menu-head' ), 454 additional = x.parent().find( '.xtra-mobile-menu-additional' ); 455 456 header.length && ul_offcanvas.prepend( '<li class="xtra-mobile-menu-head">' + header.html() + '</li>' ); 457 additional.length && ul_offcanvas.append( '<li class="xtra-mobile-menu-additional">' + additional.html() + '</li>' ); 458 459 // Add mobile menus indicator 460 if ( indicator.length || indicator2.length ) { 461 x.next( '.sf-menu' ).find( '.sf-with-ul' ).each(function() { 462 $( '.cz_indicator', this ).addClass( ( x.parent().parent().hasClass( 'sf-menu' ) ? indicator : indicator2 ) ); 463 }); 464 } 465 466 ul_offcanvas.off( 'click.offcanvas_sf_with_ul' ).on( 'click.offcanvas_sf_with_ul', '.sf-with-ul, .cz > .codevz-plus-megamenu-title', function (e) { 467 468 const $trigger = $( this ); 469 const $icon = $trigger.find( '.cz_indicator' ); 470 471 if ( $trigger.attr( 'href' ) === '#' || $( e.target ).closest( '.cz_indicator' ).length > 0 ) { 472 473 $trigger.next().slideToggle('fast'); 474 475 if ( $icon.length ) { 476 const current = $icon.data( 'rotated' ) || false; 477 $icon.css( 'transform', 'rotate(' + (current ? 0 : 180) + 'deg)' ).data( 'rotated', ! current ); 478 } 479 480 e.preventDefault(); 481 } 482 }); 483 484 // Remove ul. 485 setTimeout( function() { 486 487 x.parent().find( '> ul,> .hide' ).not( x ).remove(); 488 489 // Open dropdown for active menu inside. 490 const activeParent = ul_offcanvas.find( '.current_menu' ).closest( '.current_menu' ); 491 if ( activeParent.length ) { 492 activeParent.find( '> a > .cz_indicator' ).trigger( 'click' ); 493 } 494 495 }, 250 ); 496 497 }, 250 ); 498 499 } 500 501 // OffCanvas 502 }).off( 'click.offcanvas_container_i' ).on( 'click', '.offcanvas_container > i', function() { 503 504 var x = $( this ); 505 506 if ( ! x.hasClass( 'done' ) ) { 507 508 Codevz.offCanvas( x.addClass( 'done' ), 1 ); 509 510 } 511 512 // Fullscreen Menu 513 }).off( 'click.icon_fullscreen_menu' ).on( 'click', '.icon_fullscreen_menu', function( e ) { 514 515 var x = $( '.fullscreen_menu' ); 516 517 body.addClass( 'cz_noStickySidebar' ).find( '.fixed_side_1.have_center' ).find( '.fullscreen_menu,.xtra-close-icon' ).appendTo( '.fixed_side_1.have_center' ); 518 519 x.fadeIn( 'fast' ).on( 'click', function( e ) { 520 521 if ( ! $( e.target ).closest( '.cz' ).length ) { 522 523 $( this ).delay( 500 ).fadeOut( 'fast', function() { 524 body.removeClass( 'cz_noStickySidebar' ); 525 $( '.xtra-close-icon' ).addClass( 'hide' ); 526 page.removeClass( 'no-scroll' ); 527 }); 528 529 } 530 531 }); 532 533 if ( x.is(':visible') ) { 534 535 page.addClass( 'no-scroll' ); 536 537 } 538 539 var h = x.find( '> li' ).height() * ( ( x.find( '> li' ).length - 1 ) / 2 ); 540 541 x.css( 'padding-top', ( ( wind.height() / 2 ) - h ) ); 542 543 $( '.xtra-close-icon' ).toggleClass( 'hide' ).off().on( 'click', function() { 544 $( this ).addClass( 'hide' ); 545 x.fadeOut( 'fast' ); 546 page.removeClass( 'no-scroll' ); 547 }); 548 549 // Fullscreen 550 }).off( 'click.fullscreen_menu' ).on( 'click.fullscreen_menu', 'ul.fullscreen_menu .cz', function( e ) { 551 552 if ( $( e.target ).hasClass( 'cz_indicator' ) ) { 553 $( this ).closest( 'li' ).find( '> ul' ).fadeToggle( 'fast' ); 554 e.preventDefault(); 555 e.stopPropagation(); 556 } 557 558 // Hidden fullwidth content 559 }).off( 'click.hf_elm_icon' ).on( 'click.hf_elm_icon', '.hf_elm_icon', function( e ) { 560 561 var x = $( this ), 562 r = x.closest( '.row' ); 563 564 page.toggleClass( 'no-scroll' ); 565 566 setTimeout( function() { 567 x.toggleClass( 'czico-close' ).next( '.hf_elm_area' ).toggleClass( 'hf_elm_area_active' ).css({ 568 width: inla.outerWidth(), 569 left: inla.offset().left, 570 top: r.position().top + r.outerHeight() + ( $( '#wpadminbar' ).length ? 32 : 0 ) 571 }); 572 }, 100 ); 573 574 body.on( 'click.cz_hf_elm', function(e) { 575 if ( ! $( e.target ).closest( '.hf_elm_area' ).length ) { 576 x.removeClass( 'czico-close' ).next( '.hf_elm_area' ).removeClass( 'hf_elm_area_active' ); 577 body.off( 'click.cz_hf_elm' ); 578 page.removeClass( 'no-scroll' ); 579 } 580 }); 581 582 e.preventDefault(); 583 e.stopPropagation(); 584 585 }); 586 587 // Add clear. 588 document.querySelectorAll( '.tagcloud' ).forEach( el => el.classList.add( 'clr' ) ); 589 590 // Input buttons to button tag 591 document.querySelectorAll( '.form-submit .submit, input.search-submit, .wpcf7-submit' ).forEach( el => { 592 const btn = document.createElement( 'button' ); 593 btn.type = 'submit'; 594 btn.name = 'submit'; 595 btn.className = el.className; 596 btn.textContent = el.value; 597 el.parentNode.insertBefore(btn, el.nextSibling); 598 el.remove(); 599 }); 600 601 this.menu_anchor(); 602 }, 603 604 // Menu Anchor. 605 menu_anchor: function() { 606 607 // Disable Elementor links anchor. 608 if ( typeof elementorFrontend !== 'undefined' && typeof elementorFrontend.utils !== 'undefined' && typeof elementorFrontend.utils.anchors !== 'undefined' ) { 609 610 setTimeout(function() { 611 elementorFrontend.elements.$document.off( 612 'click', 613 elementorFrontend.utils.anchors.getSettings('selectors.links'), 614 elementorFrontend.utils.anchors.handleAnchorLinks 615 ); 616 }, 500); 617 618 } 619 620 // Prevent hashtag link click jump. 621 document.body.addEventListener( 'click', (e) => { 622 if ( e.target.closest( "a[href*='#']:not([target='_blank'])" ) ) { 623 e.preventDefault(); 624 } 625 }); 626 627 // Init. 628 var aBar = body.hasClass( 'admin-bar' ) ? 32 : 0, 629 mLink = $( "a[href*='#']" ).not( "a[href='#'],a[target='_blank'],a[href*='#/']" ), 630 sticky = $( '.header_is_sticky' ).not( '.smart_sticky, .header_4' ), 631 scrollTop = 0, timeout, 632 scrollToAnchor = function( target ) { 633 634 clearTimeout( timeout ); 635 636 timeout = setTimeout( function() { 637 638 $( window ).trigger( 'scroll' ); // Fix target position. 639 640 target = target.replace( '%20', ' ' ); 641 target = ( target.indexOf( '#' ) >= 0 ) ? $( target ) : $( '#' + target ); 642 643 if ( target.length && ! target.hasClass( 'cz_popup_modal' ) ) { 644 645 scrollTop = $( document ).scrollTop(); 646 647 if ( wind.width() < 768 && $( '.header_4.header_is_sticky' ).length ) { 648 sticky = $( '.header_4.header_is_sticky' ).not( '.smart_sticky' ); 649 } 650 651 if ( scrollTop == 0 && sticky.length ) { 652 $( document ).scrollTop( 1 ); 653 } 654 655 setTimeout( function() { 656 657 page.animate({ scrollTop: target.offset().top - aBar - ( sticky.outerHeight() || 0 ) }, 1200, 'easeInOutCodevz', function() { 658 659 page.stop( true, true ); 660 661 }); 662 663 $( '.offcanvas-close' ).trigger( 'click' ); 664 665 }, scrollTop == 0 ? 450 : 1 ); 666 667 } 668 669 }, 50 ); 670 671 }; 672 673 // Links. 674 if ( mLink.length ) { 675 676 mLink.off( 'click.anchor' ).on( 'click.anchor', function( e ) { 677 678 if ( $( this ).not( 'a[href*="#top"],[data-tab],.cz_popup_modal,.cz_no_anchor,.cz_no_anchor a, .vc_general, .cz_no_anchor a, .cz_lrpr a, .wc-tabs a, .page-numbers a, #cancel-comment-reply-link, .vc_carousel-control, [data-vc-container],.comment-form-rating a,.sm2-bar-ui a,.lwptoc a' ).length ) { 679 680 if ( ! $( e.target ).hasClass( 'cz_indicator' ) ) { 681 682 if ( $( this.hash ).length && location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname ) { 683 scrollToAnchor( this.hash ); 684 } else if ( this.hash ) { 685 location = $( this ).attr( 'href' ); 686 } 687 688 } 689 690 e.preventDefault(); 691 692 } 693 694 }); 695 696 var mPage = $( '.sf-menu' ), 697 mPageH = mPage.outerHeight() + 15, 698 mItems = mPage.find( "a[href*='#']" ).not( "a[href='#'],a[href*='#/']" ), 699 sItems = mItems.map(function(){ 700 var item = $( $( this ).attr( "href" ).replace( /\s+|%20/g, "" ).replace( /^.*\#(.*)$/g, "#$1" ) ); 701 if ( item.length ) { 702 return item; 703 } 704 }); 705 706 wind.on( 'scroll.anchor', function() { 707 708 clearTimeout( timeout ); 709 710 timeout = setTimeout( function() { 711 712 var ft = $( this ).scrollTop() + mPageH + aBar + ( sticky.outerHeight() || 0 ), 713 cur = sItems.map(function() { 714 if ( $(this).offset().top < ft ) 715 return this; 716 }); 717 718 cur = cur[cur.length-1]; 719 var id = cur && cur.length ? cur[0].id : ""; 720 if ( id && ! $( '#' + id + '.cz_popup_modal' ).length && $( '#' + id ).length ) { 721 body.trigger( 'click' ); 722 mItems.parent().removeClass( "current_menu" ).end().filter( "[href*='#" + id + "']" ).parent().addClass( "current_menu" ); 723 } else { 724 mItems.parent().removeClass( "current_menu" ); 725 } 726 727 }, 50 ); 728 729 }); 730 } 731 }, 732 733 /* 734 * offCanvas area 735 */ 736 offCanvas: function( selector, click, area ) { 737 738 var parent = selector.parent(), 739 area = area || selector.next(), 740 layout = $( '#layout' ),
741 overlay = $( '.cz_overlay' ), 742 isRight, i, 743 fixed_side = 0, 744 close, timeout; 745 746 if ( area.length ) { 747 748 var area = area.clone(), 749 isRight = area.hasClass( 'inview_right' ), 750 new_class = area.hasClass('sf-menu') ? 'sf-menu offcanvas_area' : 'offcanvas_area offcanvas_original'; 751 752 body.prepend( area.removeClass().addClass( 'sidebar_offcanvas_area' ).addClass( new_class + ( isRight ? ' inview_right' : ' inview_left' ) ) ); 753 var area_w = area.width() + 80; 754 755 if ( selector.closest( '.elementor-element' ).length ) { 756 757 var elementor_page = selector.closest( '.elementor' ).attr( 'data-elementor-id' ); 758 body.addClass( 'elementor-page-' + elementor_page + ' elementor-' + elementor_page ); 759 760 var classList = selector.closest( '.elementor-element' ).attr('class').split(/\s+/); 761 $.each( classList, function( index, item ) { 762 if ( item.indexOf( 'elementor-element-' ) == 0 ) { 763 area.addClass( 'elementor-element ' + item ); 764 } 765 }); 766 767 } 768 769 area.find( '.sub-menu' ).hide(); 770 771 } else { 772 773 return; 774 775 } 776 777 // Open icon 778 selector.on( 'click', function(e) { 779 780 if ( area.hasClass( 'active_offcanvas' ) && ! body.hasClass( 'offcanvas_doing' ) ) { 781 782 page.removeClass( 'no-scroll' ); 783 784 overlay.trigger( 'click' ); 785 786 } else { 787 788 page.addClass( 'no-scroll' ); 789 790 $( 'html' ).css( 'margin-top', '0 !important' ); 791 $( '#layout' ).css( 'margin-top', '40px !important' ); 792 793 // Close icon 794 if ( body.attr( 'class' ).indexOf( 'codevz-plus' ) >= 0 ) { 795 area.before( '<i class="fa czico-198-cancel offcanvas-close" aria-hidden="true"></i>' ); 796 } else { 797 area.before( '<i class="fa fa-times offcanvas-close" aria-hidden="true"></i>' ); 798 } 799 close = area.prev( '.offcanvas-close' ); 800 close.on( 'click', function(e) { 801 if ( click ) { 802 body.removeClass( 'active_offcanvas' ); 803 area.removeClass( 'active_offcanvas' ); 804 805 overlay.fadeOut(); 806 setTimeout(function() { 807 $( '.offcanvas-close' ).detach(); 808 wind.trigger( 'resize' ); 809 page.removeClass( 'no-scroll' ); 810 }, 500 ); 811 812 click = 0; 813 } else { 814 overlay.trigger( 'click' ); 815 } 816 }); 817 close.css( ( isRight ? 'right' : 'left' ), area.outerWidth() + fixed_side ); 818 819 body.addClass( 'offcanvas_doing active_offcanvas' + ( isRight ? ' cz_offcanvas_right' : ' cz_offcanvas_left' ) ); 820 area.addClass( 'active_offcanvas' ); 821 822 if ( wind.width() > 768 ) { 823 824 if ( ( $( '.fixed_side_left' ).length && $( '.cz_offcanvas_left' ).length ) || $( '.fixed_side_right' ).length && $( '.cz_offcanvas_right' ).length ) { 825 if ( ! $( '#cz_ofs' ).length ) { 826 $( 'head' ).append( '<style id="cz_ofs"></style>' ); 827 } 828 fixed_side = $( '.fixed_side' ).width(); 829 $( '#cz_ofs' ).html( '.active_offcanvas .offcanvas_area.active_offcanvas{transform:translateX(' + ( isRight ? '-' : '' ) + fixed_side + 'px)}' ); 830 } 831 832 } 833 834 setTimeout(function() { 835 836 overlay.css( 'z-index', '' ).fadeIn(); 837 838 }, 150 ); 839 840 setTimeout(function() { 841 842 body.removeClass( 'offcanvas_doing' ); 843 844 if ( area.find( '.cz_acc_child' ).length ) { 845 846 Codevz_Plus.accordion(); 847 848 } 849 850 }, 1250 ); 851 852 } 853 854 e.stopPropagation(); 855 }); 856 857 // First time 858 if ( click ) { 859 selector.trigger( 'click' ); 860 } 861 862 // Prevent close on open icon 863 area.on( 'click', function(e) { 864 e.stopPropagation(); 865 }); 866 867 // reCall anchors 868 this.menu_anchor(); 869 870 // Click on body 871 overlay.on( 'click', function( e ) { 872 873 if ( $( '.active_offcanvas' ).length && ! body.hasClass( 'offcanvas_doing' ) ) { 874 875 body.removeClass( 'active_offcanvas' ); 876 area.removeClass( 'active_offcanvas' ); 877 878 overlay.fadeOut(); 879 880 setTimeout(function() { 881 882 $( '.offcanvas-close' ).detach(); 883 wind.trigger( 'resize' ); 884 page.removeClass( 'no-scroll' ); 885 886 }, 500 ); 887 888 } 889 890 setTimeout(function() { 891 892 if ( ! overlay.is( ':visible' ) && $( '.active_offcanvas' ).length ) { 893 894 $( '.offcanvas-close' ).trigger( 'click' ); 895 896 page.removeClass( 'no-scroll' ); 897 898 } 899 900 }, 500 ); 901 902 }); 903 904 // Close mobile on window resize. 905 wind.on( 'resize.offcanvas_close', function( e ) { 906 907 clearTimeout( timeout ); 908 909 timeout = setTimeout( function() { 910 911 var mh4 = $( '#menu_header_4' ); 912 913 if( mh4.hasClass( 'active_offcanvas' ) && wind.width() > 768 ) { 914 mh4.prev( 'i' ).trigger( 'click' ); 915 } 916 917 }, 50 ); 918 919 }); 920 921 // Reload necessary scripts. 922 if( ! area.hasClass( 'xtra-reload-js' ) ) { 923 924 // Fix menu icon click issue specially on mobile. 925 area.find( '.cz a' ).on( 'click', function( e ) { 926 927 if ( $( e.target ).hasClass( 'cz_indicator' ) ) { 928 929 var en = $( this ); 930 931 en.attr( 'data-href', en.attr( 'href' ) ).attr( 'href', '#' ); 932 933 setTimeout( function() { 934 en.attr( 'href', en.attr( 'data-href' ) ); 935 }, 250 ); 936 937 } 938 939 }); 940 941 // reInit codevz plus. 942 var a="css lightGallery accordion animated_text google_map counter countdown grid login subscribe slick popup tabs progress_bar working_hours".split(" "); 943 for(var i=0;i<a.length;i++){ 944 var f=Codevz_Plus[a[i]]; 945 if(typeof f==="function"){f();} 946 } 947 948 // Inside offcanvas. 949 setTimeout( function() { 950 951 area.find( '.cz_tooltip' ).removeClass( 'cz_tooltip_down cz_tooltip_right cz_tooltip_left' ).addClass( 'cz_tooltip_up' ); 952 953 }, 500 ); 954 955 // reInit contact form 7. 956 if( typeof wpcf7 != 'undefined' && area.find( '.wpcf7' ).length ) { 957
958 area.find( 'form.wpcf7-form' ).each( function( i, form ) { 959 if ( wpcf7 ) { 960 wpcf7.init( form ); 961 } 962 }); 963 964 } 965 966 // reInit Facebook. 967 setTimeout( function(){ 968 if ( window.FB ) { 969 FB.XFBML.parse(); 970 } 971 }, 2000 ); 972 973 area.addClass( 'xtra-reload-js' ); 974 975 } 976 977 // Remove from DOM. 978 setTimeout( function() { 979 selector.next( '.offcanvas_area' ).remove(); 980 }, 250 ); 981 982 }, 983 984 // Height changed = run callback. 985 heightChanged: function( elm, callback, newHeight ) { 986 987 const isJquery = (elm instanceof jQuery); 988 var lastHeight = isJquery ? elm.outerHeight() : elm.offsetHeight; 989 990 // First. 991 callback(); 992 993 // Height detect. 994 ( function run() { 995 996 newHeight = isJquery ? elm.outerHeight() : elm.offsetHeight; 997 998 if ( lastHeight != newHeight ) { 999 callback(); 1000 lastHeight = newHeight; 1001 } 1002 1003 if ( elm.onElementHeightChangeTimer ) { 1004 clearTimeout( elm.onElementHeightChangeTimer ); 1005 } 1006 1007 elm.onElementHeightChangeTimer = setTimeout( run, 10 ); 1008 1009 })(); 1010 1011 } 1012 1013 }; 1014 1015})( jQuery ); 1016 1017jQuery( function( $ ) { 1018 Codevz.init(); 1019});
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.