Subversion Repositories SmartDukaan

Rev

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

Rev 5038 Rev 6866
Line 22... Line 22...
22
	
22
	
23
	$('#searchButton').click(function(){
23
	$('#searchButton').click(function(){
24
		submitSeachForm();
24
		submitSeachForm();
25
	});
25
	});
26
	
26
	
-
 
27
	$('input.mk_filter').change(function(){
-
 
28
		var search = window.location.search;
-
 
29
		if(window.location.search=="") {
-
 
30
			search = "?";
-
 
31
		}
-
 
32
		var currenturl = window.location.pathname + search;
-
 
33
		if(this.checked) {
-
 
34
			window.location = (currenturl) + this.value;
-
 
35
		} else {
-
 
36
			window.location = (currenturl).replace(this.value, "");
-
 
37
		}
-
 
38
	});
-
 
39
	$('a.mk_filter').click(function(){
-
 
40
		//first remove all fqs except category and sub category when 
-
 
41
		//any of the category links are clicked
-
 
42
		var search = window.location.search;
-
 
43
		if(window.location.search=="") {
-
 
44
			search = "?";
-
 
45
		}
-
 
46
		var currenturl = window.location.pathname + search;
-
 
47
		classNames = $(this).attr("class");
-
 
48
		if(classNames.indexOf("mk_bold") >= 0) {
-
 
49
			//if this is selected category filter, remove subcategory filter from url
-
 
50
			window.location = currenturl.replace($(this).closest('ul').find('.mk_bold.mk_subcategory').attr("value"), "");
-
 
51
		}else {
-
 
52
			//check if sub-category is changed, if yes then remove the previous sub-category and add this sub-category
-
 
53
			if(classNames.indexOf("mk_subcategory") >= 0) {
-
 
54
				window.location = currenturl.replace($(this).closest('ul').find('.mk_bold.mk_subcategory').attr("value"), "") + $(this).attr("value");
-
 
55
			}else {
-
 
56
				window.location = (currenturl).replace($(this).closest('ul').find('.mk_bold.mk_category').attr("value"), "").replace($(this).closest('ul').find('.mk_bold.mk_subcategory').attr("value"),"") + $(this).attr("value");
-
 
57
			} 
-
 
58
		}
-
 
59
	});
-
 
60
	
-
 
61
	
-
 
62
	$('a.mk_filter_close').click(function(){
-
 
63
		var search = window.location.search;
-
 
64
		if(window.location.search=="") {
-
 
65
			search = "?";
-
 
66
		}
-
 
67
		var currenturl = window.location.pathname + search;
-
 
68
		var newurl = currenturl;
-
 
69
		var filterValue = $(this).attr("value");
-
 
70
		if(filterValue.indexOf("F_50010")>-1){
-
 
71
			$(this).closest('div').find('.mk_filter_close').each(function(index,value){
-
 
72
				newurl = newurl.replace($(value).attr("value"), "");
-
 
73
			});
-
 
74
		} else {
-
 
75
			newurl = newurl.replace($(this).attr("value"), "");
-
 
76
		}
-
 
77
		window.location = newurl;
-
 
78
	});
-
 
79
	
27
	$('body').mouseup(function(){
80
	$('body').mouseup(function(){
28
		var userSelector = $('#userSelector');
81
		var userSelector = $('#userSelector');
29
		var isMouseOnUserSelector = $(userSelector).data('is_mouse_on_user_selector');
82
		var isMouseOnUserSelector = $(userSelector).data('is_mouse_on_user_selector');
30
		
83
		
31
		if (typeof(isMouseOnUserSelector) == 'boolean'  && !isMouseOnUserSelector)	{
84
		if (typeof(isMouseOnUserSelector) == 'boolean'  && !isMouseOnUserSelector)	{