PageSourceSearch

https://viet-house.ru/bitrix/cache/js/s1/viethouse/template_0b07cb…aaaea9dc9b9ee9d94e062_v1.js?172902016711951

js viet-house.ru collected 2026-09-26 14:01:45 UTC 11,951 bytes, 447 lines download raw bytes

1
2; /* Start:"a:4:{s:4:"full";s:85:"/local/templates/viethouse/components/bitrix/menu/tree_accord/script.js?1617374921173";s:6:"source";s:71:"/local/templates/viethouse/components/bitrix/menu/tree_accord/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
3function OpenMenuNode(oThis)
4{
5	if (oThis.parentNode.className == '')
6		oThis.parentNode.className = 'menu-close';
7	else
8		oThis.parentNode.className = '';
9	return false;
10}
11
12/* End */
13;
14; /* Start:"a:4:{s:4:"full";s:107:"/local/templates/viethouse/components/bitrix/sale.basket.basket.line/vh_basket_mob/script.js?16173749215292";s:6:"source";s:92:"/local/templates/viethouse/components/bitrix/sale.basket.basket.line/vh_basket_mob/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
15'use strict';
16
17function BitrixSmallCart(){}
18
19BitrixSmallCart.prototype = {
20
21	activate: function ()
22	{
23		this.cartElement = BX(this.cartId);
24		this.fixedPosition = this.arParams.POSITION_FIXED == 'Y';
25		if (this.fixedPosition)
26		{
27			this.cartClosed = true;
28			this.maxHeight = false;
29			this.itemRemoved = false;
30			this.verticalPosition = this.arParams.POSITION_VERTICAL;
31			this.horizontalPosition = this.arParams.POSITION_HORIZONTAL;
32			this.topPanelElement = BX("bx-panel");
33
34			this.fixAfterRender(); // TODO onready
35			this.fixAfterRenderClosure = this.closure('fixAfterRender');
36
37			var fixCartClosure = this.closure('fixCart');
38			this.fixCartClosure = fixCartClosure;
39
40			if (this.topPanelElement && this.verticalPosition == 'top')
41				BX.addCustomEvent(window, 'onTopPanelCollapse', fixCartClosure);
42
43			var resizeTimer = null;
44			BX.bind(window, 'resize', function() {
45				clearTimeout(resizeTimer);
46				resizeTimer = setTimeout(fixCartClosure, 200);
47			});
48		}
49		this.setCartBodyClosure = this.closure('setCartBody');
50		BX.addCustomEvent(window, 'OnBasketChange', this.closure('refreshCart', {}));
51	},
52
53	fixAfterRender: function ()
54	{
55		this.statusElement = BX(this.cartId + 'status');
56		if (this.statusElement)
57		{
58			if (this.cartClosed)
59				this.statusElement.innerHTML = this.openMessage;
60			else
61				this.statusElement.innerHTML = this.closeMessage;
62		}
63		this.productsElement = BX(this.cartId + 'products');
64		this.fixCart();
65	},
66
67	closure: function (fname, data)
68	{
69		var obj = this;
70		return data
71			? function(){obj[fname](data)}
72			: function(arg1){obj[fname](arg1)};
73	},
74
75	toggleOpenCloseCart: function ()
76	{
77		if (this.cartClosed)
78		{
79			BX.removeClass(this.cartElement, 'bx-closed');
80			BX.addClass(this.cartElement, 'bx-opener');
81			this.statusElement.innerHTML = this.closeMessage;
82			this.cartClosed = false;
83			this.fixCart();
84		}
85		else // Opened
86		{
87			BX.addClass(this.cartElement, 'bx-closed');
88			BX.removeClass(this.cartElement, 'bx-opener');
89			BX.removeClass(this.cartElement, 'bx-max-height');
90			this.statusElement.innerHTML = this.openMessage;
91			this.cartClosed = true;
92			var itemList = this.cartElement.querySelector("[data-role='basket-item-list']");
93			if (itemList)
94				itemList.style.top = "auto";
95		}
96		setTimeout(this.fixCartClosure, 100);
97	},
98
99	setVerticalCenter: function(windowHeight)
100	{
101		var top = windowHeight/2 - (this.cartElement.offsetHeight/2);
102		if (top < 5)
103			top = 5;
104		this.cartElement.style.top = top + 'px';
105	},
106
107	fixCart: function()
108	{
109		// set horizontal center
110		if (this.horizontalPosition == 'hcenter')
111		{
112			var windowWidth = 'innerWidth' in window
113				? window.innerWidth
114				: document.documentElement.offsetWidth;
115			var left = windowWidth/2 - (this.cartElement.offsetWidth/2);
116			if (left < 5)
117				left = 5;
118			this.cartElement.style.left = left + 'px';
119		}
120
121		var windowHeight = 'innerHeight' in window
122			? window.innerHeight
123			: document.documentElement.offsetHeight;
124
125		// set vertical position
126		switch (this.verticalPosition) {
127			case 'top':
128				if (this.topPanelElement)
129					this.cartElement.style.top = this.topPanelElement.offsetHeight + 5 + 'px';
130				break;
131			case 'vcenter':
132				this.setVerticalCenter(windowHeight);
133				break;
134		}
135
136		// toggle max height
137		if (this.productsElement)
138		{
139			var itemList = this.cartElement.querySelector("[data-role='basket-item-list']");
140			if (this.cartClosed)
141			{
142				if (this.maxHeight)
143				{
144					BX.removeClass(this.cartElement, 'bx-max-height');
145					if (itemList)
146						itemList.style.top = "auto";
147					this.maxHeight = false;
148				}
149			}
150			else // Opened
151			{
152				if (this.maxHeight)
153				{
154					if (this.productsElement.scrollHeight == this.productsElement.clientHeight)
155					{
156						BX.removeClass(this.cartElement, 'bx-max-height');
157						if (itemList)
158							itemList.style.top = "auto";
159						this.maxHeight = false;
160					}
161				}
162				else
163				{
164					if (this.verticalPosition == 'top' || this.verticalPosition == 'vcenter')
165					{
166						if (this.cartElement.offsetTop + this.cartElement.offsetHeight >= windowHeight)
167						{
168							BX.addClass(this.cartElement, 'bx-max-height');
169							if (itemList)
170								itemList.style.top = 82+"px";
171							this.maxHeight = true;
172						}
173					}
174					else
175					{
176						if (this.cartElement.offsetHeight >= windowHeight)
177						{
178							BX.addClass(this.cartElement, 'bx-max-height');
179							if (itemList)
180								itemList.style.top = 82+"px";
181							this.maxHeight = true;
182						}
183					}
184				}
185			}
186
187			if (this.verticalPosition == 'vcenter')
188				this.setVerticalCenter(windowHeight);
189		}
190	},
191
192	refreshCart: function (data)
193	{
194		if (this.itemRemoved)
195		{
196			this.itemRemoved = false;
197			return;
198		}
199		data.sessid = BX.bitrix_sessid();
200		data.siteId = this.siteId;
201		data.templateName = this.templateName;
202		data.arParams = this.arParams;
203		BX.ajax({
204			url: this.ajaxPath,
205			method: 'POST',
206			dataType: 'html',
207			data: data,
208			onsuccess: this.setCartBodyClosure
209		});
210	},
211
212	setCartBody: function (result)
213	{
214		if (this.cartElement)
215			this.cartElement.innerHTML = result;
216		if (this.fixedPosition)
217			setTimeout(this.fixAfterRenderClosure, 100);
218	},
219
220	removeItemFromCart: function (id)
221	{
222		this.refreshCart ({sbblRemoveItemFromCart: id});
223		this.itemRemoved = true;
224		BX.onCustomEvent('OnBasketChange');
225	}
226};
227
228/* End */
229;
230; /* Start:"a:4:{s:4:"full";s:103:"/local/templates/viethouse/components/bitrix/sale.basket.basket.line/vh_basket/script.js?16173749215292";s:6:"source";s:88:"/local/templates/viethouse/components/bitrix/sale.basket.basket.line/vh_basket/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/
231'use strict';
232
233function BitrixSmallCart(){}
234
235BitrixSmallCart.prototype = {
236
237	activate: function ()
238	{
239		this.cartElement = BX(this.cartId);
240		this.fixedPosition = this.arParams.POSITION_FIXED == 'Y';
241		if (this.fixedPosition)
242		{
243			this.cartClosed = true;
244			this.maxHeight = false;
245			this.itemRemoved = false;
246			this.verticalPosition = this.arParams.POSITION_VERTICAL;
247			this.horizontalPosition = this.arParams.POSITION_HORIZONTAL;
248			this.topPanelElement = BX("bx-panel");
249
250			this.fixAfterRender(); // TODO onready
251			this.fixAfterRenderClosure = this.closure('fixAfterRender');
252
253			var fixCartClosure = this.closure('fixCart');
254			this.fixCartClosure = fixCartClosure;
255
256			if (this.topPanelElement && this.verticalPosition == 'top')
257				BX.addCustomEvent(window, 'onTopPanelCollapse', fixCartClosure);
258
259			var resizeTimer = null;
260			BX.bind(window, 'resize', function() {
261				clearTimeout(resizeTimer);
262				resizeTimer = setTimeout(fixCartClosure, 200);
263			});
264		}
265		this.setCartBodyClosure = this.closure('setCartBody');
266		BX.addCustomEvent(window, 'OnBasketChange', this.closure('refreshCart', {}));
267	},
268
269	fixAfterRender: function ()
270	{
271		this.statusElement = BX(this.cartId + 'status');
272		if (this.statusElement)
273		{
274			if (this.cartClosed)
275				this.statusElement.innerHTML = this.openMessage;
276			else
277				this.statusElement.innerHTML = this.closeMessage;
278		}
279		this.productsElement = BX(this.cartId + 'products');
280		this.fixCart();
281	},
282
283	closure: function (fname, data)
284	{
285		var obj = this;
286		return data
287			? function(){obj[fname](data)}
288			: function(arg1){obj[fname](arg1)};
289	},
290
291	toggleOpenCloseCart: function ()
292	{
293		if (this.cartClosed)
294		{
295			BX.removeClass(this.cartElement, 'bx-closed');
296			BX.addClass(this.cartElement, 'bx-opener');
297			this.statusElement.innerHTML = this.closeMessage;
298			this.cartClosed = false;
299			this.fixCart();
300		}
301		else // Opened
302		{
303			BX.addClass(this.cartElement, 'bx-closed');
304			BX.removeClass(this.cartElement, 'bx-opener');
305			BX.removeClass(this.cartElement, 'bx-max-height');
306			this.statusElement.innerHTML = this.openMessage;
307			this.cartClosed = true;
308			var itemList = this.cartElement.querySelector("[data-role='basket-item-list']");
309			if (itemList)
310				itemList.style.top = "auto";
311		}
312		setTimeout(this.fixCartClosure, 100);
313	},
314
315	setVerticalCenter: function(windowHeight)
316	{
317		var top = windowHeight/2 - (this.cartElement.offsetHeight/2);
318		if (top < 5)
319			top = 5;
320		this.cartElement.style.top = top + 'px';
321	},
322
323	fixCart: function()
324	{
325		// set horizontal center
326		if (this.horizontalPosition == 'hcenter')
327		{
328			var windowWidth = 'innerWidth' in window
329				? window.innerWidth
330				: document.documentElement.offsetWidth;
331			var left = windowWidth/2 - (this.cartElement.offsetWidth/2);
332			if (left < 5)
333				left = 5;
334			this.cartElement.style.left = left + 'px';
335		}
336
337		var windowHeight = 'innerHeight' in window
338			? window.innerHeight
339			: document.documentElement.offsetHeight;
340
341		// set vertical position
342		switch (this.verticalPosition) {
343			case 'top':
344				if (this.topPanelElement)
345					this.cartElement.style.top = this.topPanelElement.offsetHeight + 5 + 'px';
346				break;
347			case 'vcenter':
348				this.setVerticalCenter(windowHeight);
349				break;
350		}
351
352		// toggle max height
353		if (this.productsElement)
354		{
355			var itemList = this.cartElement.querySelector("[data-role='basket-item-list']");
356			if (this.cartClosed)
357			{
358				if (this.maxHeight)
359				{
360					BX.removeClass(this.cartElement, 'bx-max-height');
361					if (itemList)
362						itemList.style.top = "auto";
363					this.maxHeight = false;
364				}
365			}
366			else // Opened
367			{
368				if (this.maxHeight)
369				{
370					if (this.productsElement.scrollHeight == this.productsElement.clientHeight)
371					{
372						BX.removeClass(this.cartElement, 'bx-max-height');
373						if (itemList)
374							itemList.style.top = "auto";
375						this.maxHeight = false;
376					}
377				}
378				else
379				{
380					if (this.verticalPosition == 'top' || this.verticalPosition == 'vcenter')
381					{
382						if (this.cartElement.offsetTop + this.cartElement.offsetHeight >= windowHeight)
383						{
384							BX.addClass(this.cartElement, 'bx-max-height');
385							if (itemList)
386								itemList.style.top = 82+"px";
387							this.maxHeight = true;
388						}
389					}
390					else
391					{
392						if (this.cartElement.offsetHeight >= windowHeight)
393						{
394							BX.addClass(this.cartElement, 'bx-max-height');
395							if (itemList)
396								itemList.style.top = 82+"px";
397							this.maxHeight = true;
398						}
399					}
400				}
401			}
402
403			if (this.verticalPosition == 'vcenter')
404				this.setVerticalCenter(windowHeight);
405		}
406	},
407
408	refreshCart: function (data)
409	{
410		if (this.itemRemoved)
411		{
412			this.itemRemoved = false;
413			return;
414		}
415		data.sessid = BX.bitrix_sessid();
416		data.siteId = this.siteId;
417		data.templateName = this.templateName;
418		data.arParams = this.arParams;
419		BX.ajax({
420			url: this.ajaxPath,
421			method: 'POST',
422			dataType: 'html',
423			data: data,
424			onsuccess: this.setCartBodyClosure
425		});
426	},
427
428	setCartBody: function (result)
429	{
430		if (this.cartElement)
431			this.cartElement.innerHTML = result;
432		if (this.fixedPosition)
433			setTimeout(this.fixAfterRenderClosure, 100);
434	},
435
436	removeItemFromCart: function (id)
437	{
438		this.refreshCart ({sbblRemoveItemFromCart: id});
439		this.itemRemoved = true;
440		BX.onCustomEvent('OnBasketChange');
441	}
442};
443
444/* End */
445;; /* /local/templates/viethouse/components/bitrix/menu/tree_accord/script.js?1617374921173*/
446; /* /local/templates/viethouse/components/bitrix/sale.basket.basket.line/vh_basket_mob/script.js?16173749215292*/
447; /* /local/templates/viethouse/components/bitrix/sale.basket.basket.line/vh_basket/script.js?16173749215292*/

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.