Subversion Repositories SmartDukaan

Rev

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

Rev 24410 Rev 24556
Line 4... Line 4...
4
		counterSize='';
4
		counterSize='';
5
		loadIndent('main-content');
5
		loadIndent('main-content');
6
	});
6
	});
7
	$("button.mk_pause_button").live('click', function(){
7
	$("button.mk_pause_button").live('click', function(){
8
		var clickedButton = $(this);
8
		var clickedButton = $(this);
-
 
9
		
9
		var description = clickedButton.data("description");
10
		var description = clickedButton.data("description");
10
		var catalogId = clickedButton.data("id");
11
		var catalogId = clickedButton.data("id");
11
		getColorsForItems(catalogId, 0, "Active/pause " + description, function(itemIds){
12
		getColorsForItems(catalogId, 0, "Active/pause " + description, function(itemIds){
12
			console.log(itemIds);
13
			console.log(itemIds);
13
			if(itemIds!=null) {
14
			if(itemIds!=null) {
14
				bootbox.confirm("Confirm Update " + clickedButton.data("description") + "?", function(result){
15
				bootbox.confirm("Confirm Update " + clickedButton.data("description") + "?", function(result){
15
					if(result) {
16
					if(result) {
16
						coloredItems.forEach(function(item){
17
						coloredItems.forEach(function(item){
17
							item.active = itemIds.indexOf(item.id) >= 0;
18
							item.active = itemIds.indexOf(item.id+"") >= 0;
-
 
19
							console.log(coloredItems)
18
						});
20
						});
-
 
21
						
19
						doPostAjaxRequestWithJsonHandler(context+"/indent/confirm-pause/", JSON.stringify(coloredItems), function(response) {
22
						doPostAjaxRequestWithJsonHandler(context+"/indent/confirm-pause/", JSON.stringify(coloredItems), function(response) {
20
							if(response) {
23
							if(response) {
21
								bootbox.alert("Item/s  Updated Successfully");
24
								bootbox.alert("Item/s  Updated Successfully");
22
							} else {
25
							} else {
23
								bootbox.alert("Could not pause item");
26
								bootbox.alert("Could not pause item");
24
							}
27
							}
-
 
28
							
25
						});
29
						});
26
					}
30
					}
27
				});
31
				});
28
			}
32
			}
29
		});
33
		});