1 2// Flag for quote slider touch support. 3let sliding = false; 4 5function elementInViewport2(el) { 6 var top = el.offsetTop; 7 var left = el.offsetLeft; 8 var width = el.offsetWidth; 9 var height = el.offsetHeight; 10 11 while(el.offsetParent) { 12 el = el.offsetParent; 13 top += el.offsetTop; 14 left += el.offsetLeft; 15 } 16 17 return ( 18 top < (window.pageYOffset + window.innerHeight) && 19 left < (window.pageXOffset + window.innerWidth) && 20 (top + height) > window.pageYOffset && 21 (left + width) > window.pageXOffset 22 ); 23} 24 25function updateSearchResultcounter() { 26 let websearchcount = getSearchResultCount(); 27 let approvalsearchcount = getSearchResultCount('#approvalsresultcount'); 28 let shopsearchcount = getSearchResultCount('#shopresultcount'); 29 30 $('#webcounter').html(' (' + websearchcount +') '); 31 $('#approvalcounter').html(' (' + approvalsearchcount +') '); 32 $('#shopcounter').html(' (' + shopsearchcount +') '); 33} 34 35function hideTabsIfNoResult() { 36 let websearchcount = getSearchResultCount(); 37 let approvalsearchcount = getSearchResultCount('#approvalsresultcount'); 38 let shopsearchcount = getSearchResultCount('#shopresultcount'); 39 40 if (websearchcount === 0) { 41 $('#webcounter').parent().hide(); 42 $('#webcounter').parent().removeClass('active'); 43 $('#websearchcount').parent().removeClass( ['active', 'show']); 44 45 if (approvalsearchcount) { 46 $('#element-tb_search_tc_approvals').addClass(['active', 'show']); 47 $('#approvalcounter').parent().addClass(['active', 'show']); 48 } else if (shopsearchcount) { 49 $('#element-tb_search_tc_shop').addClass(['active', 'show']); 50 $('#shopcounter').parent().addClass(['active', 'show']); 51 } 52 } 53 54 if (approvalsearchcount === 0 ) { 55 $('#approvalcounter').parent().hide(); 56 } 57 58 if (shopsearchcount === 0 ) { 59 $('#shopcounter').parent().hide(); 60 } 61} 62 63function getSearchResultCount(blah = '#websearchcount') { 64 return ($(blah).data('count') ? $(blah).data('count') : 0); 65} 66 67function searchForRauchmelderAddOn() { 68 var searchword = $('#tx-indexedsearch-searchbox-sword').val() ? $('#tx-indexedsearch-searchbox-sword').val() : '' ; 69 //console.log(searchword); 70 if(searchword.toLowerCase() == 'rauchmelder') { 71 $('#rauchmelderresult').show(); 72 } else { 73 $('#rauchmelderresult').hide(); 74 } 75} 76 77function trackSearchedWord() { 78 var searchword = $('#tx-indexedsearch-searchbox-sword').val() ? $('#tx-indexedsearch-searchbox-sword').val() : '' ; 79 if( typeof gtag === 'function' && searchword != '' ) { 80 //console.log('searched for: ' + searchword); 81 gtag('event', 'search', { 82 'event_category': 'searchword', 83 'event_label': searchword 84 } 85 ); 86 } 87} 88 89$.fn.strech_text = function(){ 90 var elmt = $(this), 91 cont_width = elmt.width(), 92 txt = elmt.html(), 93 strippedTxt = txt.replace(/(<([^>]+)>)/ig,""), 94 one_line = $('<span class="stretch_it">' + strippedTxt + '</span>'), 95 nb_char = elmt.text().length, 96 spacing = cont_width/nb_char, 97 txt_width; 98 99 elmt.html(one_line); 100 txt_width = one_line.width(); 101 102 //console.log(one_line.html()); 103 //console.log(txt_width); 104 //console.log(cont_width); 105 106 if (txt_width < cont_width){ 107 var char_width = txt_width/nb_char, 108 ltr_spacing = spacing - char_width + (spacing - char_width)/nb_char ; 109 110 one_line.css({'letter-spacing': ltr_spacing}); 111 } else { 112 one_line.contents().unwrap(); 113 elmt.addClass('justify'); 114 } 115}; 116 117function cookiePadding() { 118 //console.log('paddingbottomcookie'); 119 var cookie_height; 120 if ($.cookie('tracking_cookie_consent') === undefined) { 121 cookie_height = $('.cc-window').outerHeight(); 122 $('#subfooter').css('padding-bottom', cookie_height); 123 } 124} 125 126$(document).ready(function() { 127 128 hideTabsIfNoResult(); 129 //search Tabs with count 130 updateSearchResultcounter(); 131 searchForRauchmelderAddOn(); 132 trackSearchedWord(); 133 134 setTimeout(function(){ 135 cookiePadding(); 136 },1000); 137 138 $('#serachrauchwarnmelder').click(function(e) { 139 e.preventDefault(); 140 $('#tx-indexedsearch-searchbox-sword').val('Rauchwarnmelder'); 141 $('#tx-indexedsearch-searchbox-button-submit').click(); 142 }); 143 144 145 // Bind scroll handler to window to toggle navbar. 146 $(window).on("load scroll", function() { 147 $("#header-top").toggleClass("scrolled", (window.pageYOffset > 75)); 148 $(".tx-indexedsearch-searchbox").toggleClass("scrolled", (window.pageYOffset > 75)); 149 }); 150 151 if ($('#download-box').length > 0) { 152 $( "#download-box-anchor" ).show(); 153 } 154 if ($( '#quicklinks-box' ).length > 0) { 155 $( '#quicklinks-box-anchor' ).show(); 156 } 157 if ($( '#publications-box' ).length > 0) { 158 $( '#publications-box-anchor' ).show(); 159 } 160 161 $('.vds-download-box-arrow').on( "click", function(e) { 162 if($(this).parent().hasClass("open")){ 163 $(this).parent().removeClass("open"); 164 $(this).parent().addClass("closed"); 165 $(this).parent().parent().parent().addClass("mobileHide"); 166 }else{ 167 $(this).parent().removeClass("closed"); 168 $(this).parent().addClass("open"); 169 $(this).parent().parent().parent().removeClass("mobileHide"); 170 } 171 }); 172 $('.vds-quicklinks-box-arrow').on( "click", function(e) { 173 if($(this).parent().hasClass("open")){ 174 $(this).parent().removeClass("open"); 175 $(this).parent().addClass("closed"); 176 $(this).parent().parent().parent().addClass("mobileHide"); 177 }else{ 178 $(this).parent().removeClass("closed"); 179 $(this).parent().addClass("open"); 180 $(this).parent().parent().parent().removeClass("mobileHide"); 181 } 182 }); 183 184 185 // -------- SLIDER ------------------------------------------------------------------------------------------- 186 187 $('.vds-x-col-slider.show-slides-3.row.noplay').slick({ 188 infinite: true, 189 lazyLoad: 'ondemand', 190 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">
190<img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Links.svg"></button>', 191 nextArrow: '<button class="slick-next" aria-label="Next" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Rechts.svg"></button>', 192 slidesToShow: 3, 193 autoplay: false, 194 slidesToScroll: 1, 195 responsive: [ 196 { 197 breakpoint: 992, 198 settings: { 199 arrows: true, 200 dots: false, 201 slidesToShow: 3 202 } 203 }, 204 { 205 breakpoint: 991, 206 settings: { 207 arrows: false, 208 dots: true, 209 slidesToShow: 2 210 } 211 }, 212 { 213 breakpoint: 575, 214 settings: { 215 arrows: false, 216 dots: true, 217 slidesToShow: 1 218 } 219 } 220 221 ] 222 }).on('setPosition', function (event, slick) { 223 if(this.id != 'undefined') { 224 justify_slides_height(this.id); 225 } 226 227 }); 228 229 // ---------------------- mit autoplay --------------------------------------- 230 231 $('.vds-x-col-slider.show-slides-3.row.play').slick({ 232 infinite: true, 233 lazyLoad: 'ondemand', 234 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Links.svg"></button>', 235 nextArrow: '<button class="slick-next" aria-label="Next" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Rechts.svg"></button>', 236 slidesToShow: 3, 237 autoplay: true, 238 slidesToScroll: 1, 239 responsive: [ 240 { 241 breakpoint: 992, 242 settings: { 243 arrows: true, 244 dots: false, 245 slidesToShow: 3 246 } 247 }, 248 { 249 breakpoint: 991, 250 settings: { 251 arrows: false, 252 dots: true, 253 slidesToShow: 2 254 } 255 }, 256 { 257 breakpoint: 575, 258 settings: { 259 arrows: false, 260 dots: true, 261 slidesToShow: 1 262 } 263 } 264 265 ] 266 }).on('setPosition', function (event, slick) { 267 if(this.id != 'undefined') { 268 justify_slides_height(this.id); 269 } 270 271 }); 272 273 // ------------------------------------------------------------------------------------- 274 275 $('.vds-three-col-slider.row').slick({ 276 infinite: true, 277 lazyLoad: 'ondemand', 278 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Links.svg"></button>', 279 nextArrow: '<button class="slick-next" aria-label="Next" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Rechts.svg"></button>', 280 slidesToShow: 3, 281 autoplay: false, 282 slidesToScroll: 1, 283 responsive: [ 284 { 285 breakpoint: 992, 286 settings: { 287 arrows: true, 288 dots: false, 289 slidesToShow: 3 290 } 291 }, 292 { 293 breakpoint: 991, 294 settings: { 295 arrows: false, 296 dots: true, 297 slidesToShow: 2 298 } 299 }, 300 { 301 breakpoint: 575, 302 settings: { 303 arrows: false, 304 dots: true, 305 slidesToShow: 1 306 } 307 } 308 309 ] 310 }).on('setPosition', function (event, slick) { 311 if(this.id != 'undefined') { 312 justify_slides_height(this.id); 313 } 314 315 }); 316 317 // ------------------------------------------------------ 318 319 $('.vds-x-col-slider.show-slides-1.row.noplay').slick({ 320 infinite: true, 321 lazyLoad: 'ondemand', 322 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Links.svg"></button>', 323 nextArrow: '<button class="slick-next" aria-label="Next" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Rechts.svg"></button>', 324 slidesToShow: 1, 325 slidesToScroll: 1, 326 autoplay: false, 327 autoplaySpeed: 2000, 328 responsive: [ 329 { 330 breakpoint: 992, 331 settings: { 332 arrows: true, 333 dots: false, 334 slidesToShow: 1 335 } 336 }, 337 { 338 breakpoint: 575, 339 settings: { 340 arrows: false, 341 dots: true, 342 slidesToShow: 1 343 } 344 } 345 346 ] 347 }).on('setPosition', function (event, slick) { 348 if(this.id != 'undefined') { 349 justify_slides_height(this.id); 350 } 351 352 }); 353 354 //mit autoplay 355 $('.vds-x-col-slider.show-slides-1.row.play').slick({ 356 infinite: true, 357 lazyLoad: 'ondemand', 358 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">
358<img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Links.svg"></button>', 359 nextArrow: '<button class="slick-next" aria-label="Next" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Rechts.svg"></button>', 360 slidesToShow: 1, 361 slidesToScroll: 1, 362 autoplay: true, 363 autoplaySpeed: 2000, 364 responsive: [ 365 { 366 breakpoint: 992, 367 settings: { 368 arrows: true, 369 dots: false, 370 slidesToShow: 1 371 } 372 }, 373 { 374 breakpoint: 575, 375 settings: { 376 arrows: false, 377 dots: true, 378 slidesToShow: 1 379 } 380 } 381 382 ] 383 }).on('setPosition', function (event, slick) { 384 if(this.id != 'undefined') { 385 justify_slides_height(this.id); 386 } 387 388 }); 389 390 //---------------------------- 391 392 $('.vds-x-col-slider.show-slides-2.row.noplay').slick({ 393 infinite: true, 394 lazyLoad: 'ondemand', 395 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Links.svg"></button>', 396 nextArrow: '<button class="slick-next" aria-label="Next" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Rechts.svg"></button>', 397 slidesToShow: 2, 398 slidesToScroll: 1, 399 autoplay: false, 400 autoplaySpeed: 2000, 401 responsive: [ 402 { 403 breakpoint: 992, 404 settings: { 405 arrows: true, 406 dots: false, 407 slidesToShow: 2 408 } 409 }, 410 { 411 breakpoint: 991, 412 settings: { 413 arrows: false, 414 dots: true, 415 slidesToShow: 2 416 } 417 }, 418 { 419 breakpoint: 575, 420 settings: { 421 arrows: false, 422 dots: true, 423 slidesToShow: 1 424 } 425 } 426 427 ] 428 }).on('setPosition', function (event, slick) { 429 if(this.id != 'undefined') { 430 justify_slides_height(this.id); 431 } 432 433 }); 434 435 // ------- mit autoplay -------------------------------------- 436 $('.vds-x-col-slider.show-slides-2.row.play').slick({ 437 infinite: true, 438 lazyLoad: 'ondemand', 439 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Links.svg"></button>', 440 nextArrow: '<button class="slick-next" aria-label="Next" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Rechts.svg"></button>', 441 slidesToShow: 2, 442 slidesToScroll: 1, 443 autoplay: true, 444 autoplaySpeed: 2000, 445 responsive: [ 446 { 447 breakpoint: 992, 448 settings: { 449 arrows: true, 450 dots: false, 451 slidesToShow: 2 452 } 453 }, 454 { 455 breakpoint: 991, 456 settings: { 457 arrows: false, 458 dots: true, 459 slidesToShow: 2 460 } 461 }, 462 { 463 breakpoint: 575, 464 settings: { 465 arrows: false, 466 dots: true, 467 slidesToShow: 1 468 } 469 } 470 471 ] 472 }).on('setPosition', function (event, slick) { 473 if(this.id != 'undefined') { 474 justify_slides_height(this.id); 475 } 476 477 }); 478 479 //--------------------------- 4 slides ------------------- 480 481 $('.vds-x-col-slider.show-slides-4.row.noplay').slick({ 482 infinite: true, 483 lazyLoad: 'ondemand', 484 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Links.svg"></button>', 485 nextArrow: '<button class="slick-next" aria-label="Next" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Rechts.svg"></button>', 486 slidesToShow: 4, 487 autoplay: false, 488 slidesToScroll: 1, 489 responsive: [ 490 { 491 breakpoint: 1200, 492 settings: { 493 arrows: true, 494 dots: false, 495 slidesToShow: 4 496 } 497 }, 498 { 499 breakpoint: 1199, 500 settings: { 501 arrows: true, 502 dots: true, 503 slidesToShow: 3 504 } 505 }, 506 { 507 breakpoint: 991, 508 settings: { 509 arrows: false, 510 dots: true, 511 slidesToShow: 2 512 } 513 }, 514 { 515 breakpoint: 575, 516 settings: { 517 arrows: false, 518 dots: true, 519 slidesToShow: 1 520 } 521 } 522 523 ] 524 }).on('setPosition', function (event, slick) { 525 if(this.id != 'undefined') { 526 justify_slides_height(this.id); 527 } 528 529 }); 530 531 // -------- mit autoplay ------------------------- 532 533 $('.vds-x-col-slider.show-slides-4.row.play').slick({ 534 infinite: true, 535 lazyLoad: 'ondemand', 536 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">
536<img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Links.svg"></button>', 537 nextArrow: '<button class="slick-next" aria-label="Next" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Rechts.svg"></button>', 538 slidesToShow: 4, 539 autoplay: true, 540 slidesToScroll: 1, 541 responsive: [ 542 { 543 breakpoint: 1200, 544 settings: { 545 arrows: true, 546 dots: false, 547 slidesToShow: 4 548 } 549 }, 550 { 551 breakpoint: 1199, 552 settings: { 553 arrows: true, 554 dots: true, 555 slidesToShow: 3 556 } 557 }, 558 { 559 breakpoint: 991, 560 settings: { 561 arrows: false, 562 dots: true, 563 slidesToShow: 2 564 } 565 }, 566 { 567 breakpoint: 575, 568 settings: { 569 arrows: false, 570 dots: true, 571 slidesToShow: 1 572 } 573 } 574 575 ] 576 }).on('setPosition', function (event, slick) { 577 if(this.id != 'undefined') { 578 justify_slides_height(this.id); 579 } 580 581 }); 582 583 // ------------------------------------------------------------------------------------- 584 585 $('.vds-big-kachel-slider').slick({ 586 infinite: true, 587 lazyLoad: 'ondemand', 588 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Weiss_Nach_Links.svg"></button>', 589 nextArrow: '<button class="slick-next" aria-label="Next" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Weiss_Nach_Rechts.svg"></button>', 590 slidesToShow: 1, 591 autoplay: false, 592 slidesToScroll: 1, 593 594 }).on('setPosition', function (event, slick) { 595 if(this.id != 'undefined') { 596 justify_slides_height(this.id); 597 } 598 599 }); 600 601 602// -------- SLIDER ENDE ------------------------- 603 604 605 $('.vds-quote-slider.row').slick({ 606 infinite: true, 607 lazyLoad: 'ondemand', 608 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Links.svg"></button>', 609 nextArrow: '<button class="slick-next" aria-label="Next" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Rechts.svg"></button>', 610 slidesToShow: 1, 611 slidesToScroll: 1, 612 responsive: [ 613 { 614 breakpoint: 992, 615 settings: { 616 arrows: true, 617 dots: false 618 } 619 }, 620 { 621 breakpoint: 991, 622 settings: { 623 arrows: false, 624 dots: true 625 } 626 } 627 628 ] 629 }).on('setPosition', function (event, slick) { 630 justify_quote_slides_heights(this); 631 }); 632 633 var swiper = new Swiper('.vds-coverflow', { 634 effect: 'coverflow', 635 centeredSlides: true, 636 slidesPerView: 'auto', 637 loop: true, 638 loopedSlides: 3, 639 /* prev, current and next have visible class 640 watchSlidesProgress: true, 641 watchSlidesVisibility: true, 642 */ 643 fadeEffect: { 644 crossFade: true 645 }, 646 coverflowEffect: { 647 rotate: 0, 648 stretch: 200, 649 depth: 1000, 650 modifier: 1, 651 slideShadows : false, 652 }, 653 navigation: { 654 nextEl: '.swiper-button-next', 655 prevEl: '.swiper-button-prev', 656 }, 657 autoplay: { 658 delay: 10000, 659 disableOnInteraction: false, 660 }, 661 }); 662 663 $(".vds-coverflow-buttonPrev").click(function() { 664 var mySwiper = document.querySelector('.vds-coverflow').swiper 665 mySwiper.slidePrev(); 666 }); 667 $(".vds-coverflow-buttonNext").click(function() { 668 var mySwiper = document.querySelector('.vds-coverflow').swiper 669 mySwiper.slideNext(); 670 }); 671 672 function myFunction() { 673 document.getElementById("demo").innerHTML = "YOU CLICKED ME!"; 674 } 675 676 $('.desktop-carousel').each(function(){ 677 $(this).children('.dcslider').slick({ 678 autoplay: false, 679 lazyLoad: 'progressive', 680 arrows: true, 681 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Links.svg"></button>', 682 nextArrow: '<button class="slick-next" aria-label="Next" type="button"><img src="/typo3conf/ext/vds_sitepackage/Resources/Public/Icons/Pfeile/Pfeil_Blau_Nach_Rechts.svg"></button>', 683 dots: true, 684 responsive: [ 685 { 686 breakpoint: 1251, 687 settings: { 688 arrows: true 689 } 690 }, 691 { 692 breakpoint: 1250, 693 settings: {
694 arrows: false 695 } 696 }, 697 ], 698 customPaging: function(slider, i){ 699 var tab = $(slider.$slides[i]).data('tab'); 700 return '<a>'+tab+'</a>'; 701 }, 702 }).slickAnimation(); 703 }); 704 705 function detectIE() { 706 if(navigator.userAgent.match(/Trident.*rv:11\./)) { 707 $('.vds-news-teaser-kachel').addClass('ie11'); 708 } 709 } 710 711 detectIE(); 712 713 $( window ).resize(function() { 714 if($( window ).width() >= 768){ 715 justify_download_box_header_height(); 716 }else{ 717 $('.vds-download-box-header').each(function(){ 718 $(this).css('min-height', '60px'); 719 }); 720 } 721 722 //console.log('resize'); 723 $('.stretch').each(function(){ 724 $(this).strech_text(); 725 }); 726 727 }); 728 729 justify_download_box_header_height(); 730 731 function justify_download_box_header_height() { 732 var download_box_header_height = 0; 733 $('.vds-download-box-header').each(function(){ 734 if(download_box_header_height < $(this).height()){ 735 download_box_header_height = $(this).height(); 736 } 737 }); 738 $('.vds-download-box-header').each(function(){ 739 $(this).css('min-height', download_box_header_height + 'px'); 740 }); 741 } 742 743 744 function justify_slides_height(id) { 745 746 //console.log('a: ' + id); 747 $('#' + id + ' .slick-slide').height('auto'); 748 var slickTrack = $('#' + id +' .slick-track'); 749 var slickTrackHeight = $(slickTrack).height(); 750 //console.log(slickTrackHeight); 751 $('#'+ id + ' .slick-slide').css('height', slickTrackHeight + 'px'); 752 } 753 754 755 function justify_quote_slides_heights() { 756 var maxHeightTop = 0; 757 var maxHeightBottom = 0; 758 759 $('.vds-quote-slider-top').each(function(){ 760 $(this).height('auto'); 761 if(maxHeightTop < $(this).height()){ 762 maxHeightTop = $(this).height(); 763 } 764 }); 765 $('.vds-quote-slider-top').each(function(){ 766 $(this).css('height', maxHeightTop + 'px'); 767 }); 768 769 $('.vds-quote-slider-bottom').each(function(){ 770 $(this).height('auto'); 771 if(maxHeightBottom < $(this).height()){ 772 maxHeightBottom = $(this).height(); 773 } 774 }); 775 $('.vds-quote-slider-bottom').each(function(){ 776 $(this).css('height', maxHeightBottom + 'px'); 777 }); 778 } 779 780 // Bind collapsing events of fullwidth-dropdowns to control ".show" class for whole header bar. 781 $(".dropdown-menu").on("show.bs.collapse", function(e) { 782 let dropdownCount = $("#header-top").data("dropdown-count") + 1; 783 $("#header-top").addClass("show").data("dropdown-count", dropdownCount); 784 }).on("hide.bs.collapse", function(e) { 785 let dropdownCount = $("#header-top").data("dropdown-count") - 1; 786 $("#header-top").data("dropdown-count", dropdownCount); 787 788 if (dropdownCount < 1) 789 $("#header-top").removeClass("show"); 790 }); 791 792 $('.stretch').each(function(){ 793 $(this).strech_text(); 794 }); 795 796 // YT Video Player 797 $(".yt-video-container").each(function() { 798 var elementID = $(this).parent().parent().attr('id'); 799 var videoURL = $(this).data("video"); 800 801 $(this).find(".acceptThirdParty").click(function() { 802 var videoHTML = '<iframe class="youtubeframe" width="560" height="315" src="https://www.youtube.com/embed/' + videoURL + '?autoplay=1&rel=0" allow="autoplay" frameborder="0"></iframe>'; 803 $("#" + elementID + " .yt-video-container").html(videoHTML); 804 }); 805 }); 806 807 // Fix select boxes with custom arrow 808 $(".frame-type-form_formframework .singleselect").click(function(event) { 809 let selectBox = $(this).find('select')[0]; 810 811 if (document.activeElement === selectBox) { 812 $(this).addClass('active'); 813 } else { 814 $(this).removeClass('active'); 815 } 816 }); 817 818 $(".frame-type-form_formframework .singleselect select").focusout(function () { 819 $(this).parent().removeClass('active'); 820 }); 821 822 // fix background when closing select by outside click without having selected an option before 823 if ($(".frame-type-form_formframework .singleselect select").length) { 824 $(document).click(function(event){ 825 if ($(event.target).closest('.frame-type-form_formframework .singleselect').length === 0) { 826 $(".frame-type-form_formframework .singleselect select").blur(); 827 } 828 }); 829 } 830 // checkbox helper to toggle checked class on label and add js class to wrap. 831 // why? 832 // html doesnt allow css-only "fake checkmarks" 833 // 1. there are no pseudo elements on self-closing tags such as the checkbox input
834 // 2. checkbox is INSIDE label, so we cant do things like input:checked + label:before 835 $(".frame-type-form_formframework .form-check-label > input[type=checkbox], .js-checkbox input[type=checkbox]").each(function(){ 836 // in ie11, the css checkmark looks weird 837 function isIe11() { 838 return !(window.ActiveXObject) && "ActiveXObject" in window; 839 } 840 if (!isIe11()) { 841 var $input = $(this); 842 function handler() { 843 $input.parent().toggleClass('checked', $input.prop('checked')); 844 } 845 $input.on("change", handler); 846 handler(); 847 $input.parent().addClass('js'); // only set appearance to none in css if handler is attached 848 } 849 }); 850 $(".frame-type-form_formframework .fileupload-wrap").each(function(){ 851 var $input = $(this).find('input[type=file]'); 852 if ($input.length && $input[0].files) { 853 var $list = $(this).find('.js-files-filenames'); 854 var $customuploadbutton = $(this).find('.js-files-btn'); 855 var $hiddenfileInput = $(this).find('input[type="file"]'); 856 $(this).addClass('js-files'); 857 858 $customuploadbutton.on('click', function(e) { 859 e.preventDefault(); 860 //console.log($hiddenfileInput); 861 $hiddenfileInput.click(); 862 }); 863 864 $input.on('change', function() { 865 $list.html(Array.prototype.map.call($input[0].files, 866 function(file) { 867 return file.name; 868 } 869 )); 870 }); 871 } 872 }); 873}); 874$(function(){ 875 var $headerTop = $("#header-top"); 876 var $navTop = $headerTop.find(".navbar").first(); 877 var $navTopContent = $navTop.find(".navbar-collapse").first(); 878 var $navMainDropdowns = $navTopContent.find(".nav-main > .nav-item.dropdown"); 879 var $allDropdowns = $navTopContent.find(".dropdown"); 880 var $window = $(window); 881 var testBreakpoint = function (breakpoint) { 882 var res = $(".breakpoint-test-" + breakpoint).css("display"); 883 return (res && res != "none"); 884 }; 885 var setBodyState = function (state) { 886 $("body").toggleClass("nav-open", state); 887 }; 888 /*open/close submenus in mobile fullscreen-nav*/ 889 $allDropdowns.each(function(){ 890 var $dropdown = $(this); 891 $dropdown.children(".open-submenu").click(function(){ 892 openSubmenu($dropdown); 893 }); 894 $dropdown.children(".dropdown-menu").children('.parent-item').click(function(){ 895 closeSubmenu($dropdown); 896 }); 897 }); 898 var openSubmenu = function($dropdown, traverseUp) { 899 $dropdown.children(".dropdown-menu").addClass("show"); 900 $dropdown.closest('.show').addClass('overflow-hidden'); //needed to solve problems with overflow-y:auto and stacked position:fixed divs 901 if (traverseUp === true) { 902 var $parentDropdown = $dropdown.parent().closest('.dropdown'); 903 if ($parentDropdown.length) 904 openSubmenu($parentDropdown); 905 } 906 }; 907 var closeSubmenu = function($dropdown) { 908 $dropdown.children('.dropdown-menu').removeClass("show").closest('.show').removeClass('overflow-hidden'); 909 }; 910 var gotoCurrentMobile = function($nav) { 911 if (testBreakpoint('lg')) return; 912 var activeItemsSortedByDepth = $nav.find('.active') 913 .toArray() 914 .sort(function(a,b){ 915 return ($(a).data('level') < $(b).data('level')) ? 1 : -1; 916 }); 917 if (activeItemsSortedByDepth.length) { 918 var $item = $(activeItemsSortedByDepth[0]); 919 if ($item.hasClass('dropdown-item')) openSubmenu($item.closest('.dropdown'), true); 920 } 921 }; 922 /*add class to body when expanding mobile fullscreen-nav*/ 923 $navTopContent.on("shown.bs.collapse", function(){ 924 setBodyState(!testBreakpoint("lg")); 925 gotoCurrentMobile($navTopContent); 926 }); 927 $navTopContent.on("hide.bs.collapse", function() { 928 setBodyState(false); 929 $navTopContent.add($allDropdowns).removeClass('overflow-hidden'); 930 }); 931 /*desktop hover styling that was not possible with pure css*/ 932 $navMainDropdowns.each(function(){ 933 var $this = $(this); 934 var $dropdown = $this.find(".dropdown-menu").first(); 935 /* ugly hack because we need additional css on parents of hover items*/ 936 $this.hover(function(){ 937 if (testBreakpoint("lg")) { 938 $this.delay(100).queue(function(){ 939 $this.addClass("show"); 940 $headerTop.addClass("dropdown-open"); 941 var left = $dropdown.offset().left; 942 $dropdown.width($("body").innerWidth()) 943 .css("padding-left", left) 944 .css("margin-left", -left); 945 $(this).dequeue(); 946 }); 947 } 948 }, function(){ 949 $this.removeClass("show"); 950 $headerTop.removeClass("dropdown-open"); 951 $dropdown.css("padding", "").css("margin", ""); 952 $this.clearQueue(); 953 }); 954 var $hasnavicon = $this.find("[data-navicon]"); 955 var $showsicon = $this.find(".iconfield"); 956 957 $hasnavicon.hover(function(){ 958 var windowwdth = window.innerWidth; 959 if(windowwdth > 991) { 960 //console.log('icon'); 961 //console.log(windowwdth); 962 $iconval = $(this).attr("data-navicon"); 963 $showsicon.find('[src="'+$iconval+'"]').addClass("activeIcon"); 964 } 965 966 }, function(){ 967 $iconval = $(this).attr("data-navicon"); 968 $showsicon.find('[src="'+$iconval+'"]').removeClass("activeIcon"); 969 }); 970 }); 971 972 973 /*remove nojs class */ 974 $headerTop.removeClass("nojs"); 975 /*toggle shrink-class */ 976 $window.on("load scroll", function() { 977 $headerTop.toggleClass("scrolled", (window.pageYOffset > 75)); 978 }); 979 $window.on("resize", function(){ 980 /*remove body class for open menu when resizing mobile => desktop*/ 981 setBodyState(!testBreakpoint("lg") && $navTopContent.hasClass("show")); 982 /*close expanded dropdowns when resizing mobile => desktop*/ 983 if (testBreakpoint("lg")) { 984 $allDropdowns.find(".dropdown-menu").removeClass("show"); 985 } 986 }); 987 $navTopContent.doubleTapToGo(); 988 gotoCurrentMobile($navTopContent); 989});
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.