PageSourceSearch

https://www.chaochay.ru/catalog/view/theme/smartstore/js/quantity.js

js chaochay.ru collected 2026-10-04 22:38:56 UTC 1,277 bytes, 34 lines download raw bytes

1	function quantity_control() {
2	$('.quantity_input').each(function() {
3	$(this).attr('readonly', 'readonly');
4	var minimum = $(this).val();
5	var maximum = $(this).attr('data-maximum');
6	if(maximum <= 0) {
7		$(this).val('0');
8		$(this).parent().parent().find('.button-group').children().first().attr('disabled', 'disabled');
9		if ($('.form-group').length !=0) {
10			$(this).parent().parent().find('#button-cart').attr('disabled', 'disabled');
11		}
12		var text = 'данный товар закончился.';
13	} else {
14		var text = 'данного товара осталось всего ' + maximum + ' шт!'
15	}
16	
17	$(this).next().click(function () {
18	if ((~~$(this).prev().val()+ ~~minimum) <= ~~maximum) {
19		$(this).prev().val(~~$(this).prev().val()+ ~~minimum);
20	} else {
21	if ($(this).parent().find('.stock_warning').length ==0) { $(this).parent().append($('<span class="stock_warning">На нашем складе ' + text + '</span>').fadeIn()); }
22	$(this).parent().find('.stock_warning').fadeIn().delay('2000').fadeOut();
23	}
24	});
25	$(this).prev().click(function () {
26	if ($(this).next().val() > ~~minimum) {
27		$(this).next().val(~~$(this).next().val()- ~~minimum);
28	}
29	});
30	});
31	}
32	$(document).ready(function() {
33		quantity_control();
34	});

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.