1var riaMoreTags = { 2 options: { 3 fullEl: '.modal-list' 4 }, 5 init: function () { 6 $('body').on('click', '.list-item__tags-more', function( e ) { 7 riaMoreTags.showFullList( e, $( this )); 8 $( this ).addClass('m-active'); 9 }); 10 riaMoreTags.moreTags(); 11 window.addEventListener( "resize", function () { 12 riaMoreTags.moreTags(); 13 }); 14 }, 15 moreTags: function () { 16 $( '.list-item__tags li' ).removeClass( 'm-tomodal'); 17 18 $( '.list-item__tags' ).each(function () { 19 $( this ).find( '.list-item__tags-more' ).removeClass('m-visible' ).find('span' ).text(''); 20 var h = $(this).find('ul').height(); 21 if (h > 37) { 22 var i = 0; 23 $(this).find('li').each(function () { 24 var t = $(this).position().top; 25 if (t > 0) { 26 $(this).addClass('m-tomodal'); 27 ++i; 28 } 29 }); 30 $(this).find('.list-item__tags-more').addClass('m-visible').find('span').text(i); 31 } 32 }); 33 34 }, 35 showFullList: function (e, el) { 36 e.stopPropagation(); 37 38 $( riaMoreTags.options.fullEl ).find(' > ul' ).empty(); 39 40 el.parent().find( '.m-tomodal' ).each(function () { 41 $( riaMoreTags.options.fullEl ).find(' > ul').append( $( this ).clone() ); 42 }); 43 44 $( document ).on( 'click.hidetags', function () { 45 riaMoreTags.hideFullList(); 46 $( document ).off( 'click.hidetags'); 47 }); 48 49 this.el = el; 50 51 if (document.documentElement.clientWidth > 924) { 52 riaMoreTags.coordFullList(); 53 54 $(this.options.fullEl).addClass('active'); 55 } else { 56 $('html').addClass('modal-tags'); 57 ria.disablePageScroll(true); 58 59 if (document.documentElement.clientWidth < 400) { 60 $(this.options.fullEl).css({'right': '10px', 'left': '10px', 'bottom': '10px'}); 61 } else { 62 $(this.options.fullEl).css({'right': '10px', 'bottom': '10px'}); 63 } 64 65 $(this.options.fullEl).addClass('active'); 66 } 67 }, 68 coordFullList: function () { 69 var cw = document.documentElement.clientWidth, 70 el = this.el; 71 if (cw < 400) { 72 $(this.options.fullEl).css({'right': '10px', 'bottom': '10px', 'left': '10px', 'top': 'auto'}); 73 } else if (cw < 925) { 74 $(this.options.fullEl).css({'right': '10px', 'bottom': '10px', 'left': 'auto', 'top': 'auto'}); 75 } else { 76 var btn_top = el.offset().top, 77 btn_left = el.offset().left, 78 window_h = document.documentElement.clientHeight, 79 window_scroll = window.pageYOffset || document.documentElement.scrollTop, 80 distance_top = (btn_top - window_scroll), 81 distance_bottom = (window_scroll + window_h - btn_top), 82 popup_w = $(this.options.fullEl).width(), 83 popup_h = $(this.options.fullEl).height(), 84 popup_top = (distance_top > distance_bottom) ? btn_top - popup_h : btn_top, 85 popup_left = btn_left - popup_w; 86 87 if (distance_top > distance_bottom) { 88 $(this.options.fullEl).removeClass('m-bottom'); 89 } else { 90 $(this.options.fullEl).addClass('m-bottom'); 91 } 92 93 $(this.options.fullEl).css({ 94 'left': popup_left + 'px', 95 'top': popup_top + 'px', 96 'bottom': 'auto', 97 'right': 'auto' 98 }); 99 } 100 }, 101 hideFullList: function () { 102 $('html').removeClass('modal-tags'); 103 ria.disablePageScroll(false); 104 $('.list-item__tags-more').removeClass('m-active'); 105 106 $(this.options.fullEl).css({ 107 'left': 'auto', 108 'top': 'auto', 109 'bottom': 'auto', 110 'right': 'auto' 111 }).removeClass('active'); 112 } 113} 114 115 116$(function() { 117 riaMoreTags.init(); 118}); 119
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.