PageSourceSearch

https://carlsbergpolska.pl/assets/scripts/components/expanding-search.js

js carlsbergpolska.pl collected 2026-10-04 13:15:33 UTC 1,831 bytes, 78 lines download raw bytes

1$(document).ready(function() {
2
3	var carlsbergGroupExpandingSearch = (function() {
4 
5		// 'Private'
6		function init(){
7			
8			var submitIcon = $('.expanding-search__icon');
9			var submitInput = $('.expanding-search__input');
10			var searchBox = $('.expanding-search');
11			var isOpen = false;
12					
13			$(document).mouseup(function(){
14				if(isOpen == true){
15					submitInput.val('');
16					$('.expanding-search__button').css('z-index','-999');
17					submitIcon.click();
18				}
19			});
20			
21			$(document).keyup(function(e) { 
22				if(!$(e.target).closest('#expanding-search').length) {
23					if ( e.which === 9 ) {
24						if (isOpen == true){
25							submitInput.val('');
26							$('.expanding-search__button').css('z-index','-999');
27							submitIcon.click();
28						}
29					}
30				}        
31			});
32			
33			submitIcon.mouseup(function(){
34				return false;
35			});
36		
37			searchBox.mouseup(function(){
38				return false;
39			});
40		
41			submitIcon.on('click', function(){
42				if(isOpen == false){
43					searchBox.addClass('expanding-search-open');
44					$('.expanding-search__input').focus();
45					isOpen = true;
46				} else {
47					searchBox.removeClass('expanding-search-open');
48					isOpen = false;
49				}
50			});
51			
52			submitInput.on('focus', function() {				
53				searchBox.addClass('expanding-search-open');
54				isOpen = true;
55			});
56			
57			submitInput.keyup(function() {	
58				var valux = $('.expanding-search__input').val(); 
59				valux = $.trim(valux).length;
60				if(valux !== 0){
61					$('.expanding-search__button').css('z-index','99');
62				} else {
63					$('.expanding-search__input').val(''); 
64					$('.expanding-search__button').css('z-index','-999');
65				}
66			});
67			
68		}
69		
70		// 'Public'
71		return {
72			init: init
73		};
74
75	})();
76 
77	carlsbergGroupExpandingSearch.init();
78});

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.