1$( document ).ready(function() { 2 3 // Desktop menu 4 5 // Submenu: Modify entries 6 if ( $( "#sub1-menu li.active" ).length && $( "#sub2-menu li" ).length ) { 7 // Remove Sub1-Entries if Sub2 is selected 8 $( "#sub1-menu li.active" ).append( "<b>//</b>" ); 9 $( "#sub1-menu li.active, #sub2-menu li" ).css({ 10 'display' : 'block', 11 'float' : 'left' 12 }); 13 } else { 14 // Else display all 15 $( "#sub1-menu li, #sub2-menu li" ).css({ 16 'display' : 'block', 17 'float' : 'left' 18 }); 19 } 20 // Submenu: Show entries 21 $( "#sub1-menu ul" ).delay( 200 ).show( 0 ); 22 $( "#sub2-menu ul" ).delay( 400 ).show( 0 ).animate({ 23 marginLeft: "8" 24 }, 200 ); 25 26 27 28 // Mobile menu 29 30 // Add extra entry for teaser pages 31 $( "#navigation_compact li.sub > a.sub" ).each(function() { 32 $( this ).next( "ul" ).prepend( "<li><a href='" + $( this ).attr( 'href' ) +"' title='" + $( '#navigation_compact' ).data( 'teaserentry-label' ) + "'>" + $( '#navigation_compact' ).data( 'teaserentry-label' ) + "</a></li>" ); 33 }); 34 35 // On opening 36 $( "#mobile-icon-menu" ).click( function() { 37 if ( $( this ).hasClass( "open" ) ) { 38 // Hide mobile menu 39 $( "#navigation_compact" ).animate({width: 'toggle'}, 180); 40 // Show page content 41 $( ".overlaydark" ).remove(); 42 // Set menu button to closed 43 $( this ).removeClass( "open" ); 44 // Re-Enable scrolling the page 45 $( "body" ).css( "overflow", "inherit" ).css( "height", "auto" ); 46 } 47 else { 48 // Change menu link background image for active accordion items 49 $( "#navigation_compact a.active.sub" ).addClass( "open" ); 50 // Show mobile menu 51 $( "#navigation_compact" ).animate({width: 'toggle'}, 180); 52 // Hide page content 53 $( "body" ).append( "<div class='overlaydark'></div>" ); 54 $( ".overlaydark" ).css( "height", ( $( "html" ).height() - 56 ) ); 55 // Set menu button to open 56 $( this ).addClass( "open" ); 57 // Disable scrolling the page 58 $( "body" ).css( "overflow", "hidden" ).css( "height", "100%" ); 59 } 60 }); 61 62 // Mobile menu navigation / on click 63 $( "#navigation_compact > ul a.sub" ).not( "#navigation_compact > ul ul.lvl-2 a.sub" ).click( function() { 64 // Open accordion 65 $( this ).toggleClass( "open" ).parent().find( ".lvl-1, .lvl-2" ).first().toggle( 200 ); 66 // Prevent default link action 67 return false; 68 }); 69 70 // Close mobile menu when clicked outside 71 // Workaround, event selection not correct 72 $( window ).on( 'click resize', function(event) { 73 if ( $( "#mobile-icon-menu" ).hasClass( "open" ) ) { 74 if ( !$(event.target).closest( "#mobile-icon-menu, #navigation_compact, .BSBSlideShow" ).length ) { 75 $( "#mobile-icon-menu" ).click(); 76 } 77 } 78 }); 79 80 81 82 // Change logo when scrolling 83 // Workaround, delete with correct menu definition 84 $( "#main-menu ul" ).prepend( $( "#logo_small" ) ); 85 86 87 88 // Sticky navigation when scrolling 89 // Get position 90 var stickyNavTop = $( "#navigation" ).offset().top; 91 // On scrolling 92 $( window ).scroll( function() { 93 // Time for sticky menu? 94 if ( $( this ).scrollTop() > stickyNavTop ) { 95 // Add class 96 $( "#navigation" ).addClass( "sticky" ); 97 // Add padding for body to prevent content movement 98 if ( $( "#navigation" ).is( ":visible" ) ) 99 $( "#content" ).css( "padding-top", "63px" ); 100 } else { 101 // Remove class 102 $( "#navigation" ).removeClass( "sticky" ); 103 // Reset body padding 104 $( "#content" ).css( "padding-top", "0" ); 105 } 106 }); 107 108 109 110 // To-top link 111 // Browser window scroll (in pixels) after which the "back to top" link is shown 112 var ToTopOffset = 300, 113 // Duration of the top scrolling animation (in ms) 114 scroll_top_duration = 700, 115 // Grab the "back to top" link 116 $back_to_top = $('.scroll-to-top'); 117 118 // Hide or show the "back to top" link 119 $(window).scroll(function(){ 120 ( $(this).scrollTop() > ToTopOffset ) ? $back_to_top.addClass('cd-is-visible') : $back_to_top.removeClass('cd-is-visible cd-fade-out'); 121 }); 122 123 // Smooth scroll to top 124 $back_to_top.on('click', function(event){ 125 event.preventDefault(); 126 $('body,html').animate({ scrollTop: 0 }, scroll_top_duration ); 127 }); 128 129}); 130 131
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.