1/* eslint-disable camelcase */ 2'use strict'; 3 4var $ = jQuery.noConflict(), 5 $w = $( window ), 6 $b = $( 'body' ), 7 $window = $( window ), 8 $window_width = $( window ).width(), 9 $fullScreenEl = $( '.full-screen' ), 10 $body = $( 'body' ), 11 $sticky_footer = $body.attr( 'sticky-footer' ), 12 $mob_menu_landscape = $body.attr( 'data-show-landscape' ), 13 $backToTop = $body.attr( 'data-backtop' ), 14 sticky_mob_en = jQuery( 'header' ).attr( 'sticky-mobile-menu' ), 15 mobile_header_version = jQuery( '.header' ).attr( 'mobile-design' ), 16 $top_bar = $( '.top-bar' ), 17 $header = $( '.header' ), 18 top_bar_height = jQuery( '.top-bar' ).outerHeight(), 19 $pageTitle = $( '.bellow_header' ), 20 resolution = 'yes' === $mob_menu_landscape ? 1024 : 830, 21 classRow = 'pi-section-w', 22 ÑlassFixedRow = 'pi-header-row-fixed', 23 ÑlassFixedRows = 'pi-header-rows-fixed', 24 ÑlassFixed = '', 25 classReducible = 'header_reduced', 26 classReduced = 'pi-row-reduced', 27 bodyLayout = $b.attr( 'data-layout' ), 28 $stickyHeader = $( '.sticky_h' ), 29 $stickyMenu = $( '.sticky_h_menu' ), 30 original_logo = jQuery( '.logo .original_logo' ), 31 scroll_logo = jQuery( '.scroll_logo' ), 32 custom_logo = jQuery( '.logo .custom_logo' ), 33 custom_logo_state = jQuery( '.logo' ).attr( 'data-custom-logo' ), 34 $reducibleRow = $stickyHeader.find( '.' + classReducible ), 35 rowsQuantity = $stickyHeader.find( '.' + classRow ).length, 36 reduceTreshold = 400, 37 instaWidget = jQuery( '.sidebar-widget' ).find( '.cr-instagram-widget' ), 38 instaWidgetContent = jQuery( '.wpb_wrapper .cr-instagram-widget' ), 39 instaFooter = jQuery( '.footer .cr-instagram-widget' ), 40 instaFooterWidget = jQuery( '.footer #footer_widget_inside .cr-instagram-widget' ), 41 stateFixed = 'default', 42 stateReduce = 'default', 43 headerTopOffset = 0, 44 scrollTop = 0, 45 img_logo = jQuery( '#branding .logo img' ).attr( 'src' ), 46 header_transparent = jQuery( '.header' ).attr( 'data-transparent' ), 47 stk_mob_menu = jQuery( '.header' ).attr( 'sticky-mobile-menu' ), 48 header_resize = jQuery( '.header' ).attr( 'data-resize' ), 49 resize_factor = jQuery( '.header' ).attr( 'resize-factor' ), 50 header_version = jQuery( '.header' ).attr( 'header-version' ), 51 header_centered = jQuery( '.header' ).attr( 'data-centered' ), 52 logo_resize = jQuery( '.header' ).attr( 'logo-resize' ), 53 logo_height = jQuery( '#branding .logo a img' ).attr( 'logo-height' ), 54 logo_padTop = jQuery( '#branding .logo' ).css( 'padding-top' ), 55 logo_padBot = jQuery( '#branding .logo' ).css( 'padding-bottom' ), 56 new_logo_height = '', 57 topSocialExpander = '', 58 body_margin_top, 59 body_padding_top, 60 body_border, 61 body_out, 62 container_out, 63 new_logo_padTop, 64 min_height, 65 new_logo_padBot, 66 logo_container_height, 67 start_resize, 68 scrHeight, 69 outerContainerWidth, 70 outerContainerHeight, 71 innerVideoHeight, 72 innerVideoWidth; 73 74/* sticky menu for mobile devices */ 75 76function sticky_mobile() { 77 var responsive_menu_height = ( jQuery( '.responsive-menu-link' ).outerHeight() || 0 ), 78 responsive_header_height =( jQuery( '.full_header' ).outerHeight() || 0), 79 top_bar_out = ( jQuery( '.top-bar' ).outerHeight() || 0), 80 adminBar = ( jQuery ( '#wpadminbar' ).outerHeight() || 0), 81 header_left = ( jQuery( '.header_inside_left ' ).outerHeight() || 0), 82 header_right = ( jQuery( '.header_inside_right ' ).outerHeight() || 0), 83 classic_menu_height = responsive_header_height + top_bar_out + header_left + header_right; 84 85 //console.log(header_left); 86 87 if ( 'yes' == sticky_mob_en ) { 88 jQuery( window ).scroll( function() { 89 if ( $window_width <= resolution ) { 90 scrollTop = jQuery( window ).scrollTop(); 91 if ( 'modern' != mobile_header_version ) { 92 if ( scrollTop >= classic_menu_height ) { 93 requestAnimationFrame( function() { 94 jQuery( '#responsive_navigation ' ).addClass( 'sticky_mobile' ); 95 jQuery( '#wrapper' ).css( 'padding-top', responsive_menu_height ); 96 }); 97 } else { 98 requestAnimationFrame( function() { 99 jQuery( '#responsive_navigation' ).removeClass( 'sticky_mobile' ); 100 jQuery( '#wrapper' ).css( 'padding-top', '' ); 101 });
102 } 103 } else { 104 if ( scrollTop >= top_bar_out ) { 105 jQuery( '.full_header' ).addClass( 'sticky_mobile' ); 106 jQuery( '#wrapper' ).css( 'padding-top', responsive_header_height ); 107 } else { 108 jQuery( '.full_header' ).removeClass( 'sticky_mobile' ); 109 jQuery( '#wrapper' ).css( 'padding-top', '' ); 110 } 111 } 112 } 113 }); 114 } 115} 116 117function sticky_header_desktop() { 118 var $windowWidth = jQuery( window ).width(), 119 header_height = jQuery( '.full_header' ).outerHeight(), 120 header_nav_height = jQuery( '#navigation' ).outerHeight(), 121 static_header_height = jQuery( '.header' ).outerHeight(), 122 header_inside_left = jQuery( '.header_inside_left' ).outerHeight(); 123 124 if ( ! top_bar_height ) { 125 top_bar_height = 1; 126 } 127 128 if ( ! header_inside_left ) { 129 header_inside_left = 0; 130 } 131 132 if ( 'boxed' == bodyLayout ) { 133 top_bar_height = 0; 134 body_margin_top = parseInt( jQuery( '#wrapper-out' ).css( 'margin-top' ).replace( 'px', '' ) ); 135 body_padding_top = parseInt( jQuery( '#wrapper-out' ).css( 'padding-top' ).replace( 'px', '' ) ); 136 body_border = parseInt( jQuery( '#wrapper-out' ).css( 'border-top' ).replace( 'px', '' ) ); 137 body_out = body_margin_top + body_padding_top + body_border; 138 top_bar_height = jQuery( '.top-bar' ).outerHeight() + body_out; 139 container_out = jQuery( '#wrapper-out' ).outerHeight(); 140 } else { 141 body_margin_top = 0; 142 } 143 144 /* Sticky header for non Modern header */ 145 146 if ( $stickyHeader.length && $windowWidth > resolution ) { 147 scrollTop = $w.scrollTop(); 148 headerTopOffset += $stickyHeader.offset().top; 149 $w.scroll( function() { 150 scrollTop = $w.scrollTop(); 151 152 if ( $windowWidth > resolution ) { 153 jQuery( '.full_header' ).css( 'height', header_height ); 154 } 155 156 if ( scrollTop >= top_bar_height ) { 157 if ( 'default' == stateFixed ) { 158 requestAnimationFrame( function() { 159 $b.addClass( 'pi-header-row-fixed' ); 160 161 if ( 'yes' === header_transparent ) { 162 if ( scroll_logo.length ) { 163 scroll_logo.removeClass( 'hide_logo' ); 164 original_logo.addClass( 'hide_logo' ); 165 } 166 167 jQuery( '.header' ).removeClass( 'header_transparent' ); 168 jQuery( '#navigation' ).removeClass( 'custom_menu_color' ); 169 } 170 }); 171 stateFixed = 'fixed'; 172 } 173 174 /* let's test if we have graphic image so we can resize it, otherwise skip */ 175 176 177 if ( 'yes' == header_resize && null != img_logo ) { 178 new_logo_height = logo_height - logo_height * resize_factor; 179 180 if ( 0 < logo_padTop.length ) { 181 new_logo_padTop = parseInt( logo_padTop.replace( 'px', '' ) ) * 0.6; 182 } 183 184 if ( 0 < logo_padBot.length ) { 185 new_logo_padBot = parseInt( logo_padBot.replace( 'px', '' ) ) * 0.6; 186 } 187 188 logo_container_height = new_logo_height + new_logo_padTop + new_logo_padBot; 189 start_resize = ( static_header_height + top_bar_height ) * 2; 190 191 /* if scroll below 200px threshold, begin resizing */ 192 193 if ( 200 <= scrollTop ) { 194 jQuery( '#branding .logo a img' ).css( 'height', new_logo_height + 'px' ); 195 jQuery( '#branding .logo' ).css( 'padding-top', new_logo_padTop ).css( 'padding-bottom', new_logo_padBot ); 196 197 if ( 'style2' != header_version && 'yes' != header_centered || 'business' === header_version ) { 198 jQuery( '#navigation > ul, .additional_icons ul, .extra_header_button, header .social-icons-wrap span.sharer, .side-panel-trigger a i, #header_search_wrap a i, .shopping_cart_icon a i' ).css( 'height', logo_container_height + 'px' ).css( 'line-height', logo_container_height + 'px' ); 199 jQuery( '#navigation' ).css( 'margin-top', '0' ); 200 } 201 } else { 202 jQuery( '#branding .logo a img' ).css( 'height', logo_height + 'px' ); 203 jQuery( '#branding .logo' ).css( 'padding-top', logo_padTop ).css( 'padding-bottom', logo_padBot ); 204 205 if ( 'style2' != header_version && 'yes' != header_centered || 'business' === header_version ) { 206 jQuery( '#navigation > ul, .additional_icons ul, .extra_header_button, header .social-icons-wrap span.sharer, .side-panel-tr
206igger a i, #header_search_wrap a i, .shopping_cart_icon a i' ).css( 'height', '' ).css( 'line-height', '' ); 207 jQuery( '#navigation' ).css( 'margin-top', '' ); 208 } 209 } 210 } 211 212 if ( 'true' == custom_logo_state ) { 213 custom_logo.removeClass( 'show_logo' ).addClass( 'hide_logo' ); 214 original_logo.removeClass( 'hide_logo' ).addClass( 'show_logo' ); 215 } 216 } else { 217 if ( 'yes' === header_transparent ) { 218 if ( scroll_logo.length ) { 219 scroll_logo.addClass( 'hide_logo' ); 220 original_logo.removeClass( 'hide_logo' ); 221 } 222 223 jQuery( '.header' ).addClass( 'header_transparent' ); 224 jQuery( '#navigation' ).addClass( 'custom_menu_color' ); 225 } 226 227 if ( 'fixed' == stateFixed ) { 228 requestAnimationFrame( function() { 229 $b.removeClass( 'pi-header-row-fixed' ); 230 }); 231 stateFixed = 'default'; 232 } 233 234 if ( 'true' == custom_logo_state ) { 235 original_logo.removeClass( 'show_logo' ).addClass( 'hide_logo' ); 236 custom_logo.removeClass( 'hide_logo' ).addClass( 'show_logo' ); 237 } 238 } 239 }); 240 } 241} // php strstr alternative for jquery 242// discuss at: http://phpjs.org/functions/strstr/ 243 244 245function strstr( haystack, needle, bool ) { 246 var pos = 0; 247 haystack += ''; 248 pos = haystack.indexOf( needle ); 249 250 if ( -1 == pos ) { 251 return false; 252 } else { 253 if ( bool ) { 254 return haystack.substr( 0, pos ); 255 } else { 256 return haystack.slice( pos ); 257 } 258 } 259} 260 261function hide_menu_when_transparent() { 262 setTimeout( function() { 263 jQuery( '.header_transparent' ).addClass( 'is_visible' ); 264 }, 300 ); 265} 266 267jQuery( document ).ready( function( $ ) { 268 hide_menu_when_transparent(); 269 var navigation_width = $( '#navigation' ).outerWidth(); 270 271 if ( window.innerWidth > resolution ) { 272 //find the form and apply the width to it: 273 setTimeout( function() { 274 $( '.header_search' ).css( 'width', navigation_width ); 275 }, 300 ); 276 } 277 278 $( function() { 279 function top_bar_nav() { 280 if ( 1025 > window.innerWidth ) { 281 jQuery( '#top-menu > li > ul.sub-menu, #top-menu > li > .woo_login_form' ).addClass( 'remove_css_animation' ); 282 jQuery( '#top-menu > li.menu-item-has-children > a, #top-menu > li.custom-login-box > a' ).click( function( e ) { 283 var $this = $( this ); 284 e.preventDefault(); 285 286 if ( $this.hasClass( 'nav-sub-opened' ) ) { 287 $this.parent().find( 'ul.sub-menu, .woo_login_form' ).slideUp( 400 ).end().end().removeClass( 'nav-sub-opened' ).addClass( 'nav-sub-closed' ); 288 } else { 289 $this.parent().find( 'ul.sub-menu, .woo_login_form' ).slideDown( 400 ).end().end().removeClass( 'nav-sub-closed' ).addClass( 'nav-sub-opened' ); 290 } 291 }); 292 } 293 } 294 295 top_bar_nav(); 296 297 /* define variables here */ 298 299 var win_height, 300 win_width, 301 container_height, 302 admin_bar, 303 tb_height, 304 full_head_height, 305 bellow_header_height, 306 content_height, 307 content_height_no_css, 308 content_height_full_template, 309 content_height_full_template_no_css, 310 mobile_nav, 311 footer_height, 312 $root = $( 'html, body' ), 313 header_height = ( jQuery( '.header' ).outerHeight() || 0 ), 314 header_height_admin = ( jQuery( '#wpadminbar' ).outerHeight() || 0), 315 header_resize_test = jQuery( '.header' ).attr( 'data-resize' ); 316 317 if ( header_height_admin ) { 318 header_height = header_height_admin + header_height; 319 } 320 321 if ( null != header_resize_test && 'yes' == header_resize_test ) { 322 header_height = header_height / 2; 323 } 324 325 function set_containers_values() { 326 win_height = window.innerHeight; 327 win_width = window.innerWidth; 328 container_height = jQuery( '#wrapper' ).outerHeight( true ); 329 admin_bar = ( jQuery( '#wpadminbar' ).outerHeight() || 0 ); 330 tb_height = jQuery( '.top-bar' ).outerHeight( true ); 331 full_head_height = jQuery( '.full_header' ).outerHeight( true ); 332 bellow_header_height = jQuery( '.page-title-breadcrumb' ).outerHeight( true ); 333 content_height = jQuery( '#wrapper' ).outerHeight( true ); 334 content_height_no_css = jQuery( '.row' ).height(); 335 footer_height = jQuery( '.footer' ).height(); 336 jQuery( '#wrapper' ).css( 'min-height', '' ); 337 } 338 339 /* if we are not on mobile and content is not big enough, than make header appear on footer */ 340 341 342 function bottom_footer() { 343 set_containers_values(); 344 345 if ( container_height < win_height ) { 346 min_height = win_height - ( admin_bar + tb_height + full_head_height + bellow_header_height + footer_height ); 347 jQuery( '#wrapper' ).css( 'min-height', min_height ); 348 } 349 } 350 351 function place_footer_on_bottom() { 352 353 /* place footer on bottom of the page */ 354 bottom_footer(); 355 356 /* on screen resize, re-run the variables and the place footer on bottom function*/ 357 358 $( window ).resize( function() { 359 set_containers_values();
360 bottom_footer(); 361 }); 362 } 363 364 function modern_title_top_padding() { 365 var header_transparent = jQuery( '.header' ).attr( 'data-transparent' ), 366 in_header_height = jQuery( '.header' ).outerHeight(), 367 add_padding = ''; 368 369 if ( 'yes' === header_transparent ) { 370 add_padding = in_header_height; 371 } 372 373 jQuery( '.design_modern .modern_heading_title_wrap' ).css( 'padding-top', add_padding ); 374 } 375 376 modern_title_top_padding(); 377 378 function post_title_fullscreen() { 379 var header_height = jQuery( '.full_header' ).outerHeight(), 380 top_bar_height = jQuery( '.top-bar' ).outerHeight(), 381 row_height = jQuery( '.modern-post-images' ).attr( 'data-height' ), 382 actual_height = ''; 383 384 if ( 'fullscreen' === row_height ) { 385 actual_height = 'calc(100vh - ' + ( header_height + top_bar_height ) + 'px)'; 386 jQuery( '.modern-post-images .modern_heading_title_wrap' ).css( 'min-height', actual_height ); 387 } 388 } 389 390 if ( $body.hasClass( 'single-post-modern' ) ) { 391 post_title_fullscreen(); 392 } 393 394 if ( 'true' == $sticky_footer ) { 395 setTimeout( function() { 396 place_footer_on_bottom(); 397 jQuery( '.footer' ).fadeIn( 100 ); 398 }, 200 ); 399 } 400 401 jQuery( 'a.jump_links, .jump_links_wrap a' ).on( 'click', function( e ) { 402 var href = $.attr( this, 'href' ); 403 e.preventDefault(); 404 $root.animate({ 405 scrollTop: $( $.attr( this, 'href' ) ).offset().top - header_height 406 }, 1000 ); 407 return false; 408 }); 409 410 /* One Page Navigation Menu logic */ 411 412 jQuery( 'body #one_page_navigation li:first-child a' ).addClass( 'active_menu_item' ); 413 jQuery( 'body #one_page_navigation a' ).on( 'click', function() { 414 jQuery( '#one_page_navigation a' ).removeClass( 'active_menu_item' ); 415 $( this ).addClass( 'active_menu_item' ); 416 417 if ( location.pathname.replace( /^\//, '' ) == this.pathname.replace( /^\//, '' ) && location.hostname == this.hostname ) { 418 var target = $( this.hash ), 419 id = $( this ).attr( 'href' ); 420 421 if ( 830 > window.innerWidth ) { 422 header_height = 0; 423 } 424 425 target = target.length ? target : $( '[name=' + this.hash.slice( 1 ) + ']' ); 426 427 if ( target.length && '#home' != id ) { 428 $( 'html,body' ).animate({ 429 scrollTop: target.offset().top - header_height 430 }, 1000 ); 431 return false; 432 } else if ( target.length && '#home' == id ) { 433 $( 'html,body' ).animate({ 434 scrollTop: 0 435 }, 1000 ); 436 return false; 437 } 438 } 439 }); 440 441 function responsive_nav() { 442 var $body = $( 'body' ), 443 $search_holder = $( '.mobile_menu_holder' ); 444 $( '.responsive-menu-link .hamburger_mobile_menu' ).click( function() { 445 if ( $body.hasClass( 'opened-nav' ) ) { 446 $body.removeClass( 'opened-nav' ).addClass( 'closed-nav' ); 447 $search_holder.slideUp( 300 ); 448 } else { 449 $body.removeClass( 'closed-nav' ).addClass( 'opened-nav' ); 450 $search_holder.slideDown( 300 ); 451 } 452 }); 453 $( window ).resize( function() { 454 if ( window.innerWidth > resolution ) { 455 $( '.mobile_menu_holder' ).slideUp( 300 ); 456 $( 'body' ).removeClass( 'opened-nav' ).addClass( 'closed-nav' ); 457 } 458 }); 459 $( '#responsive_menu .sf-sub-indicator' ).addClass( 'nav-sub-closed' ); 460 461 /* One Page Responsive Menu Logic */ 462 463 $( '#responsive_menu.one_page_navigation_mobile li a' ).click( function() { 464 var id = $( this ).attr( 'href' ); 465 466 if ( '#' !== id ) { 467 if ( $body.hasClass( 'opened-nav' ) ) { 468 $body.removeClass( 'opened-nav' ).addClass( 'closed-nav' ); 469 $search_holder.slideUp( 300 ); 470 } 471 if ( $body.hasClass( 'mobile-panel-open' ) ) { 472 $body.removeClass( 'mobile-panel-open' ).addClass( 'mobile-panel-closed' ); 473 } 474 475 if ( location.pathname.replace( /^\//, '' ) == this.pathname.replace( /^\//, '' ) && location.hostname == this.hostname ) { 476 var target = $( this.hash ); 477 target = target.length ? target : $( '[name=' + this.hash.slice( 1 ) + ']' ); 478 var responsive_menu_height = $( '.responsive-menu-link' ).outerHeight(); 479 480 if ( target.length && '#home' != id ) { 481 $( 'html,body' ).animate({ 482 scrollTop: target.offset().top - responsive_menu_height 483 }, 1000 ); 484 return false; 485 } else if ( target.length && '#home' == id ) { 486 $( 'html,body' ).animate({ 487 scrollTop: 0 488 }, 1000 ); 489 return false; 490 } 491 } 492 } 493 }); 494 $( '#responsive_menu .sf-sub-indicator' ).on( 'click', function( e ) { 495 var $this = $( this ); 496 497 if ( $this.hasClass( 'nav-sub-closed' ) ) { 498 $this.parent().siblings( 'ul' ).slideDown( 450 ).end().end().removeClass( 'nav-sub-closed' ).addClass( 'nav-sub-opened' ); 499 $this.parent().siblings( '.woo_login_form' ).slideDown( 450 ); 500 } else {
501 $this.parent().siblings( 'ul' ).slideUp( 450 ).end().end().removeClass( 'nav-sub-opened' ).addClass( 'nav-sub-closed' ); 502 $this.parent().siblings( '.woo_login_form' ).slideUp( 450 ); 503 } 504 505 e.preventDefault(); 506 }); 507 } 508 509 responsive_nav(); 510 $fullScreenEl.each( function() { 511 var element = $( this ), 512 topbarHeight = $top_bar.height(), 513 adminbarHeight = $( '#wpadminbar' ).height(), 514 pagetitleHeight = $pageTitle.height(), 515 innerwrap = $( this ).find( '.inner_wrap_margins' ), 516 headerHeight = $header.height(); 517 518 if ( 'yes' == $header.attr( 'data-transparent' ) ) { 519 headerHeight = 0; 520 } 521 522 if ( 'off' == $pageTitle.attr( 'data-ptb' ) ) { 523 pagetitleHeight = 0; 524 } 525 526 scrHeight = $window.height() - ( topbarHeight + adminbarHeight + headerHeight + pagetitleHeight ); 527 528 if ( 959 > $( window ).width() ) { 529 scrHeight = 'auto'; 530 } else { 531 element.css({ 532 'height': scrHeight 533 }); 534 innerwrap.css({ 535 top: ( scrHeight - innerwrap.outerHeight() ) / 2 + 'px', 536 position: 'relative' 537 }); 538 } 539 }); 540 }); 541 542 if ( instaFooter.length ) { 543 var instaFooterImgWidthHeight = jQuery('footer .instagram_footer_wrap .cr-instagram-widget ul > li').outerWidth(), 544 instaFooterImg = jQuery('footer .instagram_footer_wrap .cr-instagram-widget ul li img'); 545 instaFooterImgWidthHeight = ( 0 == instaFooterImgWidthHeight ) ? 195 : instaFooterImgWidthHeight; 546 instaFooterImg.css({ 547 'width' : instaFooterImgWidthHeight + 'px', 548 'height' : instaFooterImgWidthHeight + 'px' 549 }); 550 } 551 if ( instaFooterWidget.length ) { 552 instaFooterWidget.each( function() { 553 jQuery(this).addClass('insta-img-show'); 554 var instaFooterImgWidthHeight = jQuery('footer #footer_widget_inside .cr-instagram-widget ul > li').outerWidth(), 555 instaFooterImg = jQuery('footer #footer_widget_inside .cr-instagram-widget ul li img'); 556 instaFooterImgWidthHeight = ( 0 == instaFooterImgWidthHeight ) ? 195 : instaFooterImgWidthHeight; 557 instaFooterImg.css({ 558 'width' : instaFooterImgWidthHeight + 'px', 559 'height' : instaFooterImgWidthHeight + 'px' 560 }); 561 console.log(instaFooterImg); 562 }); 563 } 564 if ( instaWidget.length ) { 565 instaWidget.each( function() { 566 jQuery(this).addClass('insta-img-show'); 567 var instaImgWidthHeight = jQuery(this).find( 'ul > li' ).outerWidth(), 568 instaImg = jQuery(this).find( 'ul li img' ); 569 instaImg.css({ 570 'width' : instaImgWidthHeight + 'px', 571 'height' : instaImgWidthHeight + 'px' 572 }); 573 }); 574 } 575 if ( instaWidgetContent.length ) { 576 instaWidgetContent.each( function() { 577 jQuery(this).addClass('insta-img-show'); 578 var instaImgWidthHeight = jQuery(this).find( 'ul > li' ).outerWidth(), 579 instaImg = jQuery(this).find( 'ul li img' ); 580 instaImg.css({ 581 'width' : instaImgWidthHeight + 'px', 582 'height' : instaImgWidthHeight + 'px' 583 }); 584 }); 585 } 586 587 if ( $().tipsy ) { 588 var nTip = function nTip() { 589 $( '.ntip' ).tipsy({ 590 gravity: 's', 591 fade: true 592 }); 593 }; 594 595 nTip(); 596 } 597 598 if ( $().tipsy ) { 599 var eTip = function eTip() { 600 $( '.etip' ).tipsy({ 601 gravity: 'e', 602 fade: true 603 }); 604 }; 605 606 eTip(); 607 } 608 609 if ( $().tipsy ) { 610 var sTip = function sTip() { 611 $( '.stip' ).tipsy({ 612 gravity: 'n', 613 fade: true 614 }); 615 }; 616 617 sTip(); 618 } 619 620 function side_panels() { 621 $( '.side-panel-trigger' ).click( function( e ) { 622 e.preventDefault(); 623 $body.toggleClass( 'side-panel-open' ); 624 625 if ( $body.hasClass( 'device-touch' ) ) { 626 $body.toggleClass( 'ohidden' ); 627 } 628 $( '.close_navbar' ).click ( function( e ) { 629 e.preventDefault(); 630 $body.removeClass( 'side-panel-open' ); 631 }); 632 633 return false; 634 }); 635 636 $( document ).on( 'click', function( event ) { 637 if ( ! $( event.target ).closest( '#side-panel' ).length ) { 638 $body.toggleClass( 'side-panel-open', false ); 639 } 640 }); 641 } 642 643 function woo_side_panels() { 644 console.log('open panel'); 645 $(document).on('click', '.cr_woo_side_panel', function(e) { 646 console.log('open panelss'); 647 e.preventDefault(); 648 $body.toggleClass( 'woo-side-panel-open' ); 649 650 if ( $body.hasClass( 'device-touch' ) ) { 651 $body.toggleClass( 'ohidden' ); 652 } 653 654 return false; 655 }); 656 657 $(document).on('click', '.close_navbar', function(e) { 658 e.preventDefault(); 659 $('body').removeClass('woo-side-panel-open'); 660 }); 661 662 $( document ).on( 'click', function( event ) { 663 if ( ! $( event.target ).closest( '#woo-side-panel' ).length ) { 664 $body.toggleClass( 'woo-side-panel-open', false ); 665 } 666 }); 667 } 668 669 side_panels(); 670 woo_side_panels(); 671 672 // Auto-open panel on "added to cart" 673 $(document.body).on('added_to_cart', function(event, fragments, cart_hash, $button) { 674 if ($('body').hasClass('cr-side-panels-woo')) { 675 console.log('ð Product added to cart â opening side panel'); 676 677 $('body').addClass('woo-side-panel-open'); 678 679 if ($('body').hasClass('device-touch')) { 680 $('body').addClass('ohidden'); 681 } 682 } 683 }); 684 685 function mobile_navigation() { 686 $( '.hamburger_mobile_menu' ).click( function( e ) { 687 e.preventDefault(); 688 $body.toggleClass( 'mobile-panel-open' ); 689 690 if ( $body.hasClass( 'device-touch' ) ) { 691 $body.toggleClass( 'ohidden' ); 692 } 693 $( '.mobile-close_navbar' ).click ( function( e ) { 694 e.preventDefault(); 695 $body.removeClass( 'mobile-panel-open' ); 696 }); 697 698 return false; 699 }); 700 701 $( document ).on( 'click', function( event ) { 702 if ( ! $( event.target ).closest( '#mobile-panel' ).length ) { 703 $body.toggleClass( 'mobile-panel-open', false ); 704 } 705 }); 706 } 707 708 mobile_navigation(); 709 710 function mobile_shopping_cart() { 711 $( '.mobile_shopping_cart' ).click( function( e ) { 712 var prodCount = parseInt($(this).find('.item_counter').text(), 10); 713 714 if( 0 === prodCount ) { 715 return; 716 } 717 718 $body.toggleClass( 'mobile-shop-panel-open' ); 719 720 if ( $body.hasClass( 'device-touch' ) ) { 721 $body.toggleClass( 'ohidden' ); 722 } 723 $( '.mobile-shop-close_navbar' ).click ( function( e ) { 724 e.preventDefault(); 725 $body.removeClass( 'mobile-shop-panel-open' ); 726 }); 727 728 return false; 729 }); 730 731 $( document ).on( 'click', function( event ) { 732 if ( ! $( event.target ).closest( '#mobile-shop-panel' ).length ) { 733 $body.toggleClass( 'mobile-shop-panel-open', false ); 734 } 735 }); 736 } 737 738 mobile_shopping_cart(); 739 740 function html_video() { 741 var videoEl = $( '.video-bg:has(video)' ); 742 743 if ( 0 < videoEl.length ) { 744 videoEl.each( function() { 745 var element = $( this ), 746 elementVideo = element.find( 'video' ), 747 placeholderImg = element.attr( 'poster' ); 748 outerContainerWidth = element.outerWidth(), outerContainerHeight = element.outerHeight(), // inaltime .video-bg 749 innerVideoWidth = elementVideo.outerWidth(), innerVideoHeight = elementVideo.outerHeight(); //inaltime video tag 750 //var placeholderImg = elementVideo.attr( 'poster' ); 751
752 if ( '' != placeholderImg && 830 > window.innerWidth ) { 753 element.append( '<div class="video-placeholder" style="background-image: url(' + placeholderImg + ');"></div>' ); 754 } 755 }); 756 } 757 } 758 759 html_video(); 760 761 function header_search() { 762 $( '#header-search' ).click( function( e ) { 763 $body.toggleClass( 'hs-open' ); 764 765 if ( $body.hasClass( 'hs-open' ) ) { 766 $( '#navigation form.header_search' ).find( 'input' ).focus(); 767 } 768 769 e.stopPropagation(); 770 e.preventDefault(); 771 }); 772 } 773 774 header_search(); // Scroll to Top 775 776 if ( $( window ).width() > parseInt( $backToTop ) ) { 777 $( window ).scroll( function() { 778 if ( 450 < $( this ).scrollTop() ) { 779 $( '#gotoTop' ).fadeIn(); 780 } else { 781 $( '#gotoTop' ).fadeOut(); 782 } 783 }); 784 $( '#gotoTop' ).click( function() { 785 $( 'body,html' ).animate({ 786 scrollTop: 0 787 }, 400 ); 788 return false; 789 }); 790 } 791 792 if ( 'yes' === header_transparent ) { 793 jQuery( '.header' ).addClass( 'header_transparent' ); 794 jQuery( '#navigation' ).addClass( 'custom_menu_color' ); 795 } 796 797 $( window ).on( 'resize', function( e ) { 798 $window_width = $( window ).width(); 799 if($header.length) { 800 setTimeout( function() { 801 sticky_header_desktop(); 802 803 if ( $window_width <= resolution ) { 804 sticky_mobile(); 805 } 806 }, 200 ); 807 } 808 }).resize(); 809 810 /* modern menu sticky header */ 811 812 if ( $stickyMenu.length && $window_width > resolution ) { 813 var top_bar_height = jQuery( '.top-bar' ).outerHeight(); 814 if( !top_bar_height ) { 815 top_bar_height = 0; 816 } 817 if ( 'boxed' == bodyLayout ) { 818 body_margin_top = jQuery( '#wrapper-out' ).css( 'margin-top' ); 819 body_margin_top = body_margin_top.replace( 'px', '' ); 820 top_bar_height = top_bar_height + parseInt( body_margin_top ); 821 } else { 822 body_margin_top = 0; 823 } 824 825 scrollTop = $w.scrollTop(); 826 headerTopOffset += $stickyMenu.offset().top; 827 828 $w.scroll( function() { 829 scrollTop = $w.scrollTop(); 830 var header_height = jQuery( '.full_header' ).outerHeight(); 831 832 if ( $window_width > resolution ) { 833 jQuery( '.header_area' ).css( 'height', header_height ); 834 } 835 $( window ).resize(function() { 836 if ( $window_width < resolution ) { 837 jQuery( '.header_area' ).css( 'height', 'auto' ); 838 } 839 }); 840 var modern_menu_height = jQuery( '.second_navi' ).outerHeight(), 841 header_wrap = jQuery( '.header_wrap ' ).outerHeight(), 842 height_to_modern_header = header_wrap + top_bar_height + parseInt( body_margin_top ); 843 844 if ( scrollTop > height_to_modern_header ) { 845 if ( 'default' == stateFixed ) { 846 requestAnimationFrame( function() { 847 $b.addClass( 'pi-header-row-fixed' ); 848 }); 849 stateFixed = 'fixed'; 850 } 851 } else { 852 if ( 'fixed' == stateFixed ) { 853 requestAnimationFrame( function() { 854 $b.removeClass( 'pi-header-row-fixed' ); 855 }); 856 stateFixed = 'default'; 857 } 858 } 859 }); 860 } 861}); 862
863topSocialExpander = function topSocialExpander() { 864 var windowWidth = jQuery( window ).width(); 865 866 if ( 767 < windowWidth ) { 867 jQuery( '#style_selector' ).show(); 868 } else { 869 jQuery( '#style_selector' ).hide(); 870 } 871}; 872 873topSocialExpander(); 874jQuery( window ).resize( function() { 875 topSocialExpander(); 876});
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.