Subversion Repositories SmartDukaan

Rev

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

Rev 27694 Rev 27754
Line 115... Line 115...
115
			return;
115
			return;
116
		}
116
		}
117
		writeOldCustomerDetailsByMobileNumber(mobileNumber);
117
		writeOldCustomerDetailsByMobileNumber(mobileNumber);
118
	});
118
	});
119
	
119
	
120
	$('button.new-address-btn').live('click', function() {
120
	$(document).on('click', 'button.new-address-btn', function() {
121
		$('#newaddressModal').modal({show: true});
121
		$('#newaddressModal').modal({show: true});
122
	});
122
	});
123
	
123
	
124
	$('button.mk_add_email').live('click', function() {
124
	$(document).on('click', 'button.mk_add_email', function() {
125
		let customerObj = {};
125
		let customerObj = {};
126
		customerObj['customerId'] = customerId;
126
		customerObj['customerId'] = customerId;
127
		customerObj['emailId'] = $("#emailId").val();
127
		customerObj['emailId'] = $("#emailId").val();
128
		if(validateEmail(customerObj['emailId'])) {
128
		if(validateEmail(customerObj['emailId'])) {
129
			doPostAjaxRequestWithJsonHandler(`${context}/customer/add-email`, JSON.stringify(customerObj), function(response){
129
			doPostAjaxRequestWithJsonHandler(`${context}/customer/add-email`, JSON.stringify(customerObj), function(response){
Line 133... Line 133...
133
		} else {
133
		} else {
134
			alert("Invalid email id");
134
			alert("Invalid email id");
135
		}
135
		}
136
		
136
		
137
	});
137
	});
138
	$('button.mk_add_customer').live('click', function() {
138
	$(document).on('click', 'button.mk_add_customer', function() {
139
		customerObj = {}
139
		customerObj = {}
140
		if($("input.firstName").val().length==0) {
140
		if($("input.firstName").val().length==0) {
141
			alert("First Name is required");
141
			alert("First Name is required");
142
			return false;
142
			return false;
143
		}
143
		}
Line 152... Line 152...
152
			$( "input.search-phone").change();
152
			$( "input.search-phone").change();
153
		});
153
		});
154
		
154
		
155
		
155
		
156
	});
156
	});
157
	$('a.select-address').live('click', function() {
157
	$(document).on('click', 'a.select-address', function() {
158
		$(this).closest('table').data("addressselected", "true").find('td').css("font-weight", "normal");
158
		$(this).closest('table').data("addressselected", "true").find('td').css("font-weight", "normal");
159
		$(this).closest('tr').find('td').css("font-weight", "bold");
159
		$(this).closest('tr').find('td').css("font-weight", "bold");
160
		selectedAddressId = $(this).data("addressid");
160
		selectedAddressId = $(this).data("addressid");
161
	});
161
	});
162
	$('button.btn-add-address').live('click', function(){
162
	$(document).on('click', 'button.btn-add-address', function(){
163
		var customerAddress = {};
163
		var customerAddress = {};
164
		customerAddress['name'] = $("#firstName").val();
164
		customerAddress['name'] = $("#firstName").val();
165
		customerAddress['lastName'] = $("#lastName").val();
165
		customerAddress['lastName'] = $("#lastName").val();
166
		customerAddress['line1'] = $("#line1").val();
166
		customerAddress['line1'] = $("#line1").val();
167
		customerAddress['line2'] = $("#line2").val();
167
		customerAddress['line2'] = $("#line2").val();