Subversion Repositories SmartDukaan

Rev

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

Rev 24171 Rev 24176
Line 396... Line 396...
396
		doAjaxRequestWithJsonHandler('partner/location', 'PUT', JSON.stringify(coords), function(){
396
		doAjaxRequestWithJsonHandler('partner/location', 'PUT', JSON.stringify(coords), function(){
397
			latitude = position.coords.latitude;
397
			latitude = position.coords.latitude;
398
			longitude = position.coords.longitude;
398
			longitude = position.coords.longitude;
399
		});
399
		});
400
	}
400
	}
401
	//distance = getDistance(latitude, longitude, position.coords.latitude, position.coords.longitude);
401
	// distance = getDistance(latitude, longitude, position.coords.latitude,
-
 
402
	// position.coords.longitude);
402
}
403
}
403
 
404
 
404
function getAuthorisedWarehouses(callback){
405
function getAuthorisedWarehouses(callback){
405
	bootBoxObj = { 
406
	bootBoxObj = { 
406
		size: "small",
407
		size: "small",
Line 427... Line 428...
427
	}
428
	}
428
	else {
429
	else {
429
		bootbox.prompt(bootBoxObj);
430
		bootbox.prompt(bootBoxObj);
430
	}
431
	}
431
	
432
	
432
}
-
 
433
433
}
-
 
434
function getItemAheadOptions(jqElement, callback) {
-
 
435
	jqElement.typeahead('destroy').typeahead({
-
 
436
		source: function(q, process) {
-
 
437
			if(q.length <= 2) {
-
 
438
				console.log("Query is empty");
-
 
439
				return;
-
 
440
			} else {
-
 
441
				return $.ajax(context+"/item", {
-
 
442
					global:false,
-
 
443
					data: {query : q}, 
-
 
444
					success: function(data){
-
 
445
						console.log(data);
-
 
446
						process(JSON.parse(data));
-
 
447
					},
-
 
448
				});
-
 
449
			}
-
 
450
		},
-
 
451
		delay: 400,
-
 
452
		items: 20,
-
 
453
		displayText: function(item){return item.itemDescription;},
-
 
454
		autoSelect: true,
-
 
455
		afterSelect: callback
-
 
456
	});
-
 
457
}
-
 
458