1$.widget( "custom.catcomplete", $.ui.autocomplete, { 2 _create: function() { 3 this._super(); 4 this.widget().menu( "option", "items", "> :not(.ui-autocomplete-category)" ); 5 }, 6 _renderMenu: function( ul, items ) { 7 var that = this, 8 currentCategory = ""; 9 $.each( items, function( index, item ) { 10 var li; 11 if ( item.category != currentCategory ) { 12 ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" ); 13 currentCategory = item.category; 14 } 15 li = that._renderItemData( ul, item ); 16 if ( item.category ) { 17 li.attr( "aria-label", item.category + " : " + item.label ); 18 } 19 }); 20 } 21 }); 22 23 24 25function prislusenstvisort(attr, root) { 26 $('.prislusenstvi-vypis-seznam th', root).removeClass('sorted'); 27 $('[data-sort_attr~="'+attr+'"]', root).closest('th').addClass('sorted'); 28 $('.prislusenstvi-vypis-katalog', root).each(function(){ 29 $(this).children('div').tsort({data:'sort_'+attr,emptyEnd:true}); 30 }); 31 $('.prislusenstvi-vypis-seznam tbody', root).each(function(){ 32 $(this).children('tr').tsort({data:'sort_'+attr,emptyEnd:true}); 33 }); 34} 35 36function prislusenstvi_vypis_init() { 37 $('select.prislusenstvi-filtr').change(function(){ 38 var root=$(this).closest('.prislusenstvi-sortable'); 39 var v=$(this).val(); 40 if (v=='') { 41 $('.prislusenstvi', root).show(); 42 } else { 43 $('.prislusenstvi', root).hide(); 44 $('.prislusenstvi.' + v, root).show(); 45 } 46 }); 47 $('select.prislusenstvi-sort').change(function(){ 48 var v=$(this).val(); 49 var root=$(this).closest('.prislusenstvi-sortable'); 50 prislusenstvisort(v, root); 51 }); 52 $('.prislusenstvi-vypis-seznam th a').click(function(event){ 53 var v=$(this).data('sort_attr'); 54 var root=$(this).closest('.prislusenstvi-sortable'); 55 event.preventDefault(); 56 $('select.prislusenstvi-sort', root).val(v); 57 prislusenstvisort(v, root); 58 }); 59} 60 61$(document).ready(function(){ 62 $('.moveSectionDown').click(function(){ 63 $('html, body').animate({ 64 scrollTop: $( $(this).attr('href') ).offset().top 65 }, 800); 66 return false; 67 }); 68 69 // tlacitko nahoru pro katalog 70 if( $('.katalog-menu').length > 0 ) { 71 $('.bg-grid.bg-white').append('<div id="toTop"><span class="icon"></span>menu</div>'); 72 } 73 74 $('#toTop').click(function () { 75 $('body,html').animate({ 76 scrollTop: 0 77 }, 800); 78 }); 79 80 $.fn.is_on_screen = function(){ 81 var win = $(window); 82 var viewport = { 83 top : win.scrollTop(), 84 left : win.scrollLeft() 85 }; 86 viewport.right = viewport.left + win.width(); 87 viewport.bottom = viewport.top + win.height(); 88 89 var bounds = this.offset(); 90 bounds.right = bounds.left + this.outerWidth(); 91 bounds.bottom = bounds.top + this.outerHeight(); 92 93 return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom)); 94 }; 95 96 if (window.innerWidth > 768) { 97 if( $('.katalog-menu').length > 0 ) { // if target element exists in DOM 98 if( $('.katalog-menu').is_on_screen() ) { // if target element is visible on screen after DOM loaded 99 $('#toTop').fadeOut(); 100 } else { 101 $('#toTop').fadeIn(); 102 } 103 } 104 $(window).scroll(function(){ // bind window scroll event 105 if( $('.katalog-menu').length > 0 ) { // if target element exists in DOM 106 if( $('.katalog-menu').is_on_screen() ) { // if target element is visible on screen after DOM loaded 107 $('#toTop').fadeOut(); 108 } else { 109 $('#toTop').fadeIn(); 110 } 111 } 112 }); 113 } 114 115}); 116
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.