Subversion Repositories SmartDukaan

Rev

Rev 26512 | Rev 27047 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
26493 tejbeer 1
$(function() {
2
	$(".product-detail").live('click', function() {
3
		loadItems("main-content");
4
	});
5
	$(".product-info").live(
6
			'click',
7
			function() {
8
				console.log(itemCatalogId);
9
				doAjaxRequestHandler(context + "/getProductInfo?catalogId="
10
						+ itemCatalogId, "GET", function(response) {
11
					$('.product-info-container').html(response);
26512 amit.gupta 12
					$("#compareItem").hide();
26493 tejbeer 13
				});
14
			});
15
 
26512 amit.gupta 16
	$(".compare-with").live('click', function() {
17
		$("#compareItem").show();
26493 tejbeer 18
	});
19
 
26744 amit.gupta 20
	$(".product-compare-info").live('click',function() {
21
		catalogIds = [1021975, 1022020];
22
		if(typeof compareCatalogId!="undefined") {
23
			catalogIds.push(compareCatalogId);
24
		}
25
		doAjaxRequestHandler(`${context}/getProductCompareInfo?catalogIds=` + catalogIds.join(","), "GET", 
26
		function(response) {
27
			console.log(response)
28
			$('#' + "main-content").html(response);
29
		});
30
	});
26493 tejbeer 31
});
32
 
33
function loadItems(domId) {
34
	doAjaxRequestHandler(context + "/getProducts", "GET", function(response) {
35
		$('#' + domId).html(response);
36
	});
37
}