Subversion Repositories SmartDukaan

Rev

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

Rev 23383 Rev 23396
Line 86... Line 86...
86
            // Do nothing!
86
            // Do nothing!
87
        }
87
        }
88
    });
88
    });
89
	
89
	
90
	var shopDetailsSize = $("#shopDetailsSize").attr("size");
90
	var shopDetailsSize = $("#shopDetailsSize").attr("size");
91
	for(var i = 0; i < shopDetailsSize; i++){
91
	console.log("no of shops are : "+shopDetailsSize);
92
		$('#retailerShopDocument'+i).change(function(){
92
	$('.retailerShopDocument').change(function(){
-
 
93
		//console.log("#retailerShopDocument"+i+" change event called");
93
	        //alert("Retailer Shop Document has been selected, Do you want to upload");
94
        //alert("Retailer Shop Document has been selected, Do you want to upload");
94
	        if (confirm('Retailer Shop Document has been selected, Do you want to upload ?')) {
95
        if (confirm('Retailer Shop Document has been selected, Do you want to upload ?')) {
-
 
96
        		for(var i = 0; i < shopDetailsSize; i++){
-
 
97
        			if($('#retailerShopDocument'+i).val() != undefined){
-
 
98
        				console.log("#retailerShopDocument"+i+" change event called");
95
	        		var fileSelector = $('#retailerShopDocument'+i)[0];
99
		        		var fileSelector = $('#retailerShopDocument'+i)[0];
96
        			var url = 'http://'+ webApiHost + ':' + webApiPort + '/profitmandi-web/document-upload';
100
		    			var url = 'http://'+ webApiHost + ':' + webApiPort + '/profitmandi-web/document-upload';
97
        			var file = this.files[0];
101
		    			var file = this.files[0];
-
 
102
		    			var retailerShopDocumentKey = "retailerShopDocument"+i;
98
        			doAjaxUploadRequestHandler(url, 'POST', file, function(response){
103
		    			doAjaxUploadRequestHandler(url, 'POST', file, function(response){
99
        				var documentId = response.response.document_id; 
104
		    				var documentId = response.response.document_id;
100
        				console.log("documentId : " + documentId);
105
		    				console.log("documentId : " + documentId);
101
        				localStorage.setItem("retailerShopDocument"+i, documentId);
106
		    				localStorage.setItem(retailerShopDocumentKey, documentId);
102
        				//$('#retailerShopDocument'+i).attr("documentId", localStorage.getItem("retailerShopDocument"+i));
-
 
103
        				//console.log("updated documentId : " + $('#retailerShopDocument'+i).attr("documentId"));
107
		    			});
104
        				//return documentId;
108
        			}
105
        			});
109
        		}
106
	        } else {
110
        } else {
107
	            // Do nothing!
111
            // Do nothing!
108
	        }
112
        }
109
	    });
113
    });
110
		//
-
 
111
	}
-
 
112
    
114
    
113
});
115
});
114
 
116
 
115
function getNewShopAddressUiElements(counter){
117
function getNewShopAddressUiElements(counter){
116
	var shopAddressUi = '<div class="row">'+
118
	var shopAddressUi = '<div class="row">'+