Subversion Repositories SmartDukaan

Rev

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

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