") .data("ui-autocomplete-item", item) .append( "" + image + "
" + "" + title + ""+ ((item.top_bar && item.top_bar !== undefined) ? item.top_bar : '') + ((item.info_bar && item.info_bar !== undefined) ? item.info_bar : '') + "
" + "
" + "" ).appendTo(ul); }; } monkeyPatchAutocomplete(); var _cache = {}; $( "#header-search-input" ).autocomplete({ appendTo: "#header-search-form", minLength: 2, delay: 200, source: function( request, response ) { var term = request.term; if ( term in _cache ) { response( _cache[ term ] ); return; } request.ctype_name = ''; $.getJSON('/social/search_autocomplete', request, function( data, status, xhr ) { _cache[ term ] = data; response( data ); }); }, select: function( event, ui ) { icms.events.run('autocomplete_select', this); } }).focus(function(){ $(this).autocomplete("search"); }); }); }); } $('#hsearch').addClass('open'); $('#hsearch > form > input[type="text"]').focus(); icms.gc.hideSocTopAdv(); }); $('#header-search-input').on('click', function(event) { $('#hsearch').addClass('onsearch'); }); $('#hsearch').on('click keyup', function(event) { if (event.target == this || event.target.className == 'close' || event.keyCode == 27) { $(this).removeClass('open'); } }); $('#hsearch .header-search-close').on('click', function(event) { $('#hsearch').removeClass('open'); });
});
Для доступа к запрошенной странице необходима авторизация