1(function($) { 2 "use strict"; 3 4 UNCODE.readMoreCol = function( $el ){ 5 if ( typeof $el === 'undefined' || $el === null ) { 6 $el = $('body'); 7 } 8 var $readMoreCols = $('.uncont.overflow-hidden-mask[data-ov-height]', $el); 9 $readMoreCols.each(function(){ 10 var $uncont = $(this), 11 $row = $uncont.closest('.row-container'), 12 max_h = $uncont.attr('data-ov-height'), 13 max_h_mobile = $uncont.attr('data-ov-height-mobile'), 14 actual_max_h = $uncont.outerHeight(), 15 inner_h, 16 $read_more = $('+ .btn-more-wrap', $uncont), 17 read_more_resize = $read_more.hasClass('trigger-resize'), 18 marginClosedBtn = $uncont.attr('data-margin-closed'), 19 marginClosed = 0, 20 marginOpenBtn = $uncont.attr('data-margin-open'), 21 marginOpen = 0, 22 anim_t = 250, 23 resized = false; 24 25 max_h_mobile = typeof max_h_mobile === 'undefined' || max_h_mobile === null ? '' : max_h_mobile; 26 27 switch (marginClosedBtn) { 28 case 'sm': 29 marginClosed = 18 30 break; 31 32 case 'std': 33 marginClosed = 36 34 break; 35 36 case 'lg': 37 marginClosed = 72 38 break; 39 40 case '': 41 default: 42 marginClosed = 0 43 break; 44 45 } 46 47 switch (marginOpenBtn) { 48 case 'sm': 49 marginOpen = 18 50 break; 51 52 case 'std': 53 marginOpen = 36 54 break; 55 56 case 'lg': 57 marginOpen = 72 58 break; 59 60 case 'no': 61 marginOpen = 0 62 break; 63 64 } 65 66 var checkToggleMobile = function(){ 67 if ( UNCODE.wwidth <= UNCODE.mediaQuery && max_h_mobile !== '' ) { 68 resized = true; 69 if ( $read_more.hasClass('state-closed') ) { 70 $uncont[0].style.height = ''; 71 $uncont[0].style.maxHeight = max_h_mobile; 72 } 73 } if ( resized === true && UNCODE.wwidth > UNCODE.mediaQuery ) { 74 if ( $read_more.hasClass('state-closed') ) { 75 $uncont[0].style.height = ''; 76 $uncont[0].style.maxHeight = max_h; 77 } 78 resized = false; 79 } 80 } 81 checkToggleMobile(); 82 $(window).on('resize', function() { 83 checkToggleMobile(); 84 }); 85 86 $('a', $read_more).on('click', function(e){ 87 e.preventDefault(); 88 89 var $a = $(this); 90 91 if ( $read_more.hasClass('state-closed') ) { 92 93 $read_more 94 .removeClass('state-closed') 95 .addClass('state-open'); 96 97 $uncont.css({ 98 'max-height': 'none', 99 'height': 'auto', 100 }); 101 102 inner_h = parseFloat( $uncont.outerHeight() ); 103 104 $uncont.css({ 105 'height': ( UNCODE.wwidth <= UNCODE.mediaQuery && max_h_mobile !== '' ) ? max_h_mobile : max_h 106 }); 107 108 anim_t = inner_h - actual_max_h; 109 if ( anim_t < 250 ) { 110 anim_t = 250; 111 } else if ( anim_t > 1000 ) { 112 anim_t = 1000; 113 } 114 115 $uncont.css({ 116 'transition-duration' : anim_t + 'ms' 117 }).addClass('overflow-mask-animation').animate({ 118 'height': inner_h 119 }, anim_t, 'easeInOutCubic', function(){ 120 $uncont.css({ 121 'height' : 'auto' 122 }).removeClass('overflow-mask'); 123 if ( read_more_resize === true ) { 124 window.dispatchEvent(new Event('resize')); 125 if ( typeof ScrollTrigger !== 'undefined' && ScrollTrigger !== null ) { 126 ScrollTrigger.refresh(true); 127 } 128 } 129 }); 130 131 if ( marginOpen != '' ) { 132 $read_more.animate({ 133 'margin-top' : marginOpen 134 }, anim_t, 'easeInOutCubic'); 135 } 136 137 } else { 138 $read_more 139 .removeClass('state-open') 140 .addClass('state-closed'); 141 142 $uncont.addClass('overflow-mask').removeClass('overflow-mask-animation').animate({ 143 'height': ( UNCODE.wwidth <= UNCODE.mediaQuery && max_h_mobile !== '' ) ? max_h_mobile : max_h 144 }, anim_t, 'easeInOutCubic', function(){ 145 if ( read_more_resize === true ) { 146 window.dispatchEvent(new Event('resize')); 147 if ( typeof ScrollTrigger !== 'undefined' && ScrollTrigger !== null ) { 148 ScrollTrigger.refresh(true); 149 } 150 } 151 }); 152 153 if ( marginClosed !== '' ) { 154 $read_more.animate({ 155 'margin-top' : marginClosed 156 }, anim_t, 'easeInOutCubic'); 157 } 158 159 if ( $a.hasClass('toggle-scroll') ) { 160 var $masthead = $('#masthead > div:first-child'), 161 headH = $masthead.outerHeight(), 162 rectTop = $row[0].getBoundingClientRect().top, 163 checkNavBar = $a.hasClass('toggle-navbar'), 164 checkNavBarMobile = $a.hasClass('toggle-navbar-mobile'), 165 offCont = ( $row.offset().top ); 166 167 if ( UNCODE.wwidth <= UNCODE.mediaQuery ) { 168 checkNavBar = checkNavBarMobile; 169 } 170 171 if ( checkNavBar ) { 172 offCont = offCont - headH; 173 } 174 175 if ( rectTop < headH ) { 176 $('html, body').on("scroll wheel DOMMouseScroll mousewheel touchmove", function(){ 177 $(this).stop(); 178 }).animate({ 179 scrollTop: offCont 180 }, anim_t, 'easeInOutCubic'); 181 } 182 } 183 184 } 185 }); 186 }); 187} 188 189})(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.