PageSourceSearch

https://ritualpom.ru/g/templates/shop2/2.27.2/js/resizeController.js

js ritualpom.ru collected 2026-10-07 18:01:43 UTC 1,410 bytes, 58 lines download raw bytes

1// RESIZE_CONTROL
2
3function resizeController() {
4	var $win = $(window),
5		winWidth = $win.width(),
6		range = [],
7		func = [],
8		toggleState = [undefined, undefined];
9
10	if (!!arguments.length) {
11		for (var i = 0; i <= arguments.length-1; i++) {
12			
13			if ($.isArray(arguments[i])) {
14				range = arguments[i];
15			} else if ($.isNumeric(arguments[i])) {
16				range.push(arguments[i]);
17			} else if ($.isFunction(arguments[i])) {
18				func.push(arguments[i]);
19			} 
20		};
21	}
22
23	$win.resize(function(event) {
24		winWidth = $win.width();
25		
26		if (range.length > 1) {
27			if (winWidth >= range[0] && winWidth <= range[range.length-1] && typeof toggleState[0] === "undefined") {
28				func[0]();
29				toggleState[0] = true;
30				toggleState[1] = undefined;												
31			} else if ((winWidth < range[0] || winWidth > range[range.length-1]) && typeof toggleState[1] === "undefined") {						
32				toggleState[0] = undefined;
33				toggleState[1] = true;
34
35				if ($.isFunction(func[1])) {
36					func[1]();
37				}
38
39				
40			}
41		} else if (range.length == 1) {
42			if (winWidth <= range[0] && typeof toggleState[0] === "undefined") {
43				func[0]();
44				toggleState[0] = true;
45				toggleState[1] = undefined;
46			} else if (winWidth > range[0] && typeof toggleState[1] === "undefined") {
47				toggleState[0] = undefined;
48				toggleState[1] = true;
49
50				if ($.isFunction(func[1])) {
51					func[1]();
52				}
53			}
54		}
55
56		
57	}).trigger('resize');
58}

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.