Subversion Repositories SmartDukaan

Rev

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

Rev 24079 Rev 24168
Line 380... Line 380...
380
			latitude = position.coords.latitude;
380
			latitude = position.coords.latitude;
381
			longitude = position.coords.longitude;
381
			longitude = position.coords.longitude;
382
		});
382
		});
383
	}
383
	}
384
	//distance = getDistance(latitude, longitude, position.coords.latitude, position.coords.longitude);
384
	//distance = getDistance(latitude, longitude, position.coords.latitude, position.coords.longitude);
-
 
385
}
-
 
386
 
-
 
387
function getAuthorisedWarehouses(callback){
-
 
388
	bootBoxObj = { 
-
 
389
		size: "small",
-
 
390
		title: "Choose Warehouse", 
-
 
391
		callback: callback,
-
 
392
		inputType:'select',
-
 
393
		inputOptions : typeof inputOptions == "undefined" ? undefined : inputOptions
-
 
394
	}
-
 
395
	if(typeof inputOptions=="undefined") {
-
 
396
		doGetAjaxRequestHandler(context+"/authorisedWarehouses", function(response){
-
 
397
			response = JSON.parse(response);
-
 
398
			inputOptions = [];
-
 
399
			response.forEach(function(warehouse){
-
 
400
				inputOptions.push({
-
 
401
					text:warehouse.name,
-
 
402
					value:warehouse.id,
-
 
403
				});
-
 
404
			});
-
 
405
			bootBoxObj['inputOptions'] = inputOptions;
-
 
406
			bootbox.prompt(bootBoxObj);
-
 
407
		});
-
 
408
	} else if(inputOptions.length==1) {
-
 
409
		callback(inputOptions[0].warehouse.id);
-
 
410
	}
-
 
411
	else {
-
 
412
		bootbox.prompt(bootBoxObj);
-
 
413
	}
-
 
414
	
385
}
415
}
386
416