Subversion Repositories SmartDukaan

Rev

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

Rev 5716 Rev 5746
Line 38... Line 38...
38
			}
38
			}
39
		}
39
		}
40
	});
40
	});
41
});
41
});
42
 
42
 
-
 
43
$(function() {
-
 
44
	var zone = 'All';
-
 
45
	$('#store-address-container').find('tr').each(function() {
-
 
46
		if($(this).hasClass('default-address')) {
-
 
47
			zone = $(this).attr('zone');
-
 
48
		}
-
 
49
	});
-
 
50
	$('#' + zone).attr('selected', true);
-
 
51
	$('#zone-selector').val(zone);
-
 
52
	showSpecificStores();
-
 
53
});
-
 
54
 
-
 
55
var showSpecificStores = function() {
-
 
56
	//var rows = $(this).parents('#hotspot-address-heading').siblings('#store-address-container').find('tr');
-
 
57
	var index = 0;
-
 
58
	var rows = $('#store-address-container').find('tr');
-
 
59
	if($('#zone-selector').val() == 'All') {
-
 
60
		$(rows).show();
-
 
61
	} else {
-
 
62
		$(rows).hide();
-
 
63
		$(rows).each(function() {
-
 
64
			if($(this).attr('zone') == $('#zone-selector').val()) {
-
 
65
				index++;
-
 
66
				$(this).show();
-
 
67
			}
-
 
68
		});
-
 
69
	}
-
 
70
	if(index == 0) {
-
 
71
		var count = $(rows).length + " stores";
-
 
72
	} else if(index == 1) {
-
 
73
		var count = index + " store";
-
 
74
	} else {
-
 
75
		var count= index + " stores"
-
 
76
	}
-
 
77
	$('#store-address-header-text').text(" Select a pickup point nearest to you (" + count + " available)");
-
 
78
};
-
 
79
 
-
 
80
$("#zone-selector").change(showSpecificStores);
-
 
81
 
43
$(".unselected-tab").live('click', function() {
82
$(".unselected-tab").live('click', function() {
44
	var tabToBeSelected = $(this).attr('id');
83
	var tabToBeSelected = $(this).attr('id');
45
	if(tabToBeSelected == 'tab-left') {
84
	if(tabToBeSelected == 'tab-left') {
46
		$("#tabSelector").val("myLocation");
85
		$("#tabSelector").val("myLocation");
47
		$('#tabSelectorForAddAddressForm').val('myLocation');
86
		$('#tabSelectorForAddAddressForm').val('myLocation');