Subversion Repositories SmartDukaan

Rev

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

Rev 23971 Rev 24019
Line 1... Line 1...
1
$(function() {
1
$(function() {
2
	$(".price_drop").live('click', function() {
2
	$(".price_drop").live('click', function() {
3
		loadPriceDrop("main-content");
3
		loadPriceDrop("main-content");
4
	});
4
	});
-
 
5
	$("button.update-mop").live('click', function() {
-
 
6
		if($("#typeaheaditem").val().trim().length == 0){
-
 
7
			alert("Please choose Item");
-
 
8
			return;
-
 
9
		}
-
 
10
		var newMop = $("#newMop").val();
-
 
11
		var allColors = $("#allColors").prop('checked');
-
 
12
 
-
 
13
		if(newMop.length == 0 || parseFloat(newMop) == 0) {
-
 
14
			alert("New Mop should not be empty");
-
 
15
			return;
-
 
16
		}
-
 
17
		if(confirm("Are you sure?")) {
-
 
18
			var obj = {
-
 
19
					itemId:currentItem.itemId,
-
 
20
					mop:parseFloat(newMop),
-
 
21
					allColors:allColors,
-
 
22
			}
-
 
23
			doPostAjaxRequestWithJsonHandler(
-
 
24
					context+"/updateMop", JSON.stringify(obj),
-
 
25
					function(response) {
-
 
26
						if (response == 'true') {
-
 
27
							$('#newPriceDropModal').find('button.close').trigger('click');
-
 
28
							setTimeout(() => {
-
 
29
								alert("PriceDrop added successfully")
-
 
30
								loadPriceDrop("main-content");
-
 
31
							}, 500);
-
 
32
						} else {
-
 
33
							alert("Something went wrong pls try after sometime");
-
 
34
						}
-
 
35
					}
-
 
36
			);
-
 
37
		}
-
 
38
	});
5
	$("button.addPriceDrop").live('click', function() {
39
	$("button.addPriceDrop").live('click', function() {
6
		if($("#typeaheaditem").val().trim().length == 0){
40
		if($("#typeaheaditem").val().trim().length == 0){
7
			alert("Please choose Item");
41
			alert("Please choose Item");
8
			return;
42
			return;
9
		}
43
		}