Subversion Repositories SmartDukaan

Rev

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

Rev 26452 Rev 27022
Line 28... Line 28...
28
 
28
 
29
$(document).ajaxError(function(event, jqxhr, settings, thrownError) {
29
$(document).ajaxError(function(event, jqxhr, settings, thrownError) {
30
	if (typeof loaderDialogObj != "undefined")
30
	if (typeof loaderDialogObj != "undefined")
31
		{
31
		{
32
			loaderDialogObj.modal('hide');
32
			loaderDialogObj.modal('hide');
33
			$('div.modal-backdrop.fade').remove();
33
			//$('div.modal-backdrop.fade').remove();
34
		}
34
		}
35
	if (jqxhr.status == 400) {
35
	if (jqxhr.status == 400) {
36
		// $('#error-prompt-model').modal();
36
		// $('#error-prompt-model').modal();
37
		badRequestAlert(jqxhr);
37
		badRequestAlert(jqxhr);
38
	} else {
38
	} else {
Line 41... Line 41...
41
});
41
});
42
 
42
 
43
$(document).ajaxComplete(function() {
43
$(document).ajaxComplete(function() {
44
	if (typeof loaderDialogObj != "undefined") {
44
	if (typeof loaderDialogObj != "undefined") {
45
		loaderDialogObj.modal('hide');
45
		loaderDialogObj.modal('hide');
46
		$('div.modal-backdrop.fade').remove();
46
		//$('div.modal-backdrop.fade').remove();
47
	}
47
	}
48
});
48
});
49
function ajaxStartHandler() {
49
function ajaxStartHandler() {
50
	if (typeof loaderDialogObj != "undefined")
50
	if (typeof loaderDialogObj != "undefined")
51
		loaderDialogObj.modal('show');
51
		loaderDialogObj.modal('show');
Line 262... Line 262...
262
			}
262
			}
263
		} else if (xhttp.readyState === 4 && xhttp.status === 200) {
263
		} else if (xhttp.readyState === 4 && xhttp.status === 200) {
264
			// Trick for making downloadable link
264
			// Trick for making downloadable link
265
			if (typeof loaderDialogObj != "undefined") {
265
			if (typeof loaderDialogObj != "undefined") {
266
				loaderDialogObj.modal('hide');
266
				loaderDialogObj.modal('hide');
267
				$('div.modal-backdrop.fade').remove();
267
				//$('div.modal-backdrop.fade').remove();
268
			}
268
			}
269
			
269
			
270
			a = document.createElement('a');
270
			a = document.createElement('a');
271
			a.href = window.URL.createObjectURL(xhttp.response);
271
			a.href = window.URL.createObjectURL(xhttp.response);
272
			// Give filename you wish to download
272
			// Give filename you wish to download
Line 275... Line 275...
275
			document.body.appendChild(a);
275
			document.body.appendChild(a);
276
			a.click();
276
			a.click();
277
		} else if (xhttp.readyState == 4 && xhttp.status === 400) {
277
		} else if (xhttp.readyState == 4 && xhttp.status === 400) {
278
			if (typeof loaderDialogObj != "undefined") {
278
			if (typeof loaderDialogObj != "undefined") {
279
				loaderDialogObj.modal('hide');
279
				loaderDialogObj.modal('hide');
280
				$('div.modal-backdrop.fade').remove();
280
				//$('div.modal-backdrop.fade').remove();
281
			}
281
			}
282
			badRequestAlert(xhttp);
282
			badRequestAlert(xhttp);
283
		} else if (xhttp.readyState == 4 && xhttp.status === 500) {
283
		} else if (xhttp.readyState == 4 && xhttp.status === 500) {
284
			if (typeof loaderDialogObj != "undefined") {
284
			if (typeof loaderDialogObj != "undefined") {
285
				loaderDialogObj.modal('hide');
285
				loaderDialogObj.modal('hide');
286
				$('div.modal-backdrop.fade').remove();
286
				//$('div.modal-backdrop.fade').remove();
287
			}
287
			}
288
			internalServerErrorAlert(xhttp);
288
			internalServerErrorAlert(xhttp);
289
		}
289
		}
290
	};
290
	};
291
	// Post data to URL which handles post request
291
	// Post data to URL which handles post request
Line 524... Line 524...
524
				selected : item.active
524
				selected : item.active
525
			});
525
			});
526
		});
526
		});
527
		bootBoxObj['inputOptions'] = inputOptions;
527
		bootBoxObj['inputOptions'] = inputOptions;
528
		promptObj = bootbox.prompt(bootBoxObj);
528
		promptObj = bootbox.prompt(bootBoxObj);
-
 
529
		promptObj.modal('show')
529
		$('.item-wrapper').find("input[type='checkbox']").slice(1).each(
530
		$('.item-wrapper').find("input[type='checkbox']").slice(1).each(
530
				function(index, checkbox) {
531
				function(index, checkbox) {
531
					checkbox.checked = coloredItems[index].active;
532
					checkbox.checked = coloredItems[index].active;
532
				});
533
				});
533
		promptObj.modal('show')
-
 
534
	});
534
	});
535
}
535
}
536
$(".item-wrapper").find("input[type='checkbox']:first").live(
536
$(".item-wrapper").find("input[type='checkbox']:first").live(
537
		'change',
537
		'change',
538
		function() {
538
		function() {
Line 555... Line 555...
555
						process(queryData);
555
						process(queryData);
556
					},
556
					},
557
				});
557
				});
558
			}
558
			}
559
		},
559
		},
560
		delay : 400,
560
		delay : 300,
561
		items : 20,
561
		items : 20,
562
		displayText : function(item) {
562
		displayText : function(item) {
563
			return item.itemDescription;
563
			return item.itemDescription;
564
		},
564
		},
565
		autoSelect : true,
565
		autoSelect : true,
Line 580... Line 580...
580
						process(queryData);
580
						process(queryData);
581
					},
581
					},
582
				});
582
				});
583
			}
583
			}
584
		},
584
		},
585
		delay : 400,
585
		delay : 300,
586
		items : 20,
586
		items : 20,
587
		displayText : function(entity) {
587
		displayText : function(entity) {
588
			return entity.title_s + "(" + entity.catalogId_i + ")";
588
			return entity.title_s + "(" + entity.catalogId_i + ")";
589
		},
589
		},
590
		autoSelect : true,
590
		autoSelect : true,