Subversion Repositories SmartDukaan

Rev

Rev 5862 | Rev 6021 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5862 Rev 5889
Line 14... Line 14...
14
		if(Entity.orderedItems){
14
		if(Entity.orderedItems){
15
			$.each(Entity.orderedItems, function(index, sort) {
15
			$.each(Entity.orderedItems, function(index, sort) {
16
				select.find('option[value="' + sort + '"]').appendTo(select);
16
				select.find('option[value="' + sort + '"]').appendTo(select);
17
			});
17
			});
18
			$("#item_id").val(Entity.orderedItems[0]);
18
			$("#item_id").val(Entity.orderedItems[0]);
-
 
19
			onColorSelectorChange(Entity.orderedItems[0]);
19
		}
20
		}
20
		select.find("option:eq(0)").remove();
21
		select.find("option:eq(0)").remove();
21
		updateEstimate(getSeletectedItemId());
-
 
22
	}
22
	}
23
 
23
 
24
    var prodid = $("#product_id").val();
24
    var prodid = $("#product_id").val();
25
    
25
    
26
	add_to_storage_set("histitems", prodid);
26
	add_to_storage_set("histitems", prodid);
Line 72... Line 72...
72
		});
72
		});
73
	});
73
	});
74
	
74
	
75
	$("#colorSelector").change(function(){
75
	$("#colorSelector").change(function(){
76
		var itemid = $("#colorSelector option:selected").val();
76
		var itemid = $("#colorSelector option:selected").val();
77
		$('#sp').html(PARAMETERS[itemid].SP);
-
 
78
		$('#mrp').html(PARAMETERS[itemid].MRP);
-
 
79
		$('#saving').html(PARAMETERS[itemid].SAVING);
-
 
80
		$("#item_id").val(itemid);
-
 
81
		updateEstimate(itemid);
77
		onColorSelectorChange(itemid);
82
		return false;
78
		return false;
83
	});
79
	});
84
	
80
	
85
	$(".util_compare").click(function() {
81
	$(".util_compare").click(function() {
86
		$.colorbox({
82
		$.colorbox({
Line 243... Line 239...
243
		    $("#mostcompared table td div div.text").each(function() {
239
		    $("#mostcompared table td div div.text").each(function() {
244
					$(this).truncate( {addtitle : true});
240
					$(this).truncate( {addtitle : true});
245
			});
241
			});
246
	    }
242
	    }
247
	});
243
	});
-
 
244
}
-
 
245
function onColorSelectorChange(itemid){
-
 
246
	$('#sp').html(PARAMETERS[itemid].SP);
-
 
247
	$('#mrp').html(PARAMETERS[itemid].MRP);
-
 
248
	$('#saving').html(PARAMETERS[itemid].SAVING);
-
 
249
	$("#item_id").val(itemid);
-
 
250
	updateEstimate(itemid);
248
}
251
}
249
252