Subversion Repositories SmartDukaan

Rev

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

Rev 3966 Rev 4180
Line 1... Line 1...
1
$(function(){
1
$(function(){
-
 
2
	$("#userSelector .default").truncate({addtitle: true});
2
	
3
	
3
	function submitSeachForm()	{
4
	function submitSeachForm()	{
4
		var query = $.trim($('#query').val());
5
		var query = $.trim($('#query').val());
5
		
6
		
6
		if(query != '' && query != 'Search for more items...')	{
7
		if(query != '' && query != 'Search for more items...')	{
Line 53... Line 54...
53
	$('.search-in-dropdown-options li').click(function(){
54
	$('.search-in-dropdown-options li').click(function(){
54
		var category = $(this).attr('id').split('_')[2];
55
		var category = $(this).attr('id').split('_')[2];
55
		$('input[name="category"]').val(category);
56
		$('input[name="category"]').val(category);
56
		submitSeachForm();
57
		submitSeachForm();
57
	});
58
	});
-
 
59
	
-
 
60
	$('body').mouseup(function(){
-
 
61
		var userSelector = $('#userSelector');
-
 
62
		var isMouseOnUserSelector = $(userSelector).data('is_mouse_on_user_selector');
-
 
63
		
-
 
64
		if (typeof(isMouseOnUserSelector) == 'boolean'  && !isMouseOnUserSelector)	{
-
 
65
			$(userSelector).children('ul').hide();
-
 
66
			$(userSelector).data('usermenustate', false);
-
 
67
			$(userSelector).removeClass('active');
-
 
68
		}
-
 
69
	});
-
 
70
	
-
 
71
	$('#userSelector').click(function(){
-
 
72
			
-
 
73
		var userMenuState = $(this).data('usermenustate');
-
 
74
		
-
 
75
		if (typeof(userMenuState) == 'undefined' || !userMenuState)	{
-
 
76
			$(this).addClass('active');
-
 
77
			$(this).children('ul').show();
-
 
78
			$(this).data('usermenustate', true);
-
 
79
		} else	{
-
 
80
			$(this).removeClass('active');
-
 
81
			$(this).children('ul').hide();
-
 
82
			$(this).data('usermenustate', false);
-
 
83
		}
-
 
84
	}).hover(function(){
-
 
85
		$(this).data('is_mouse_on_user_selector', true);
-
 
86
	}, function(){
-
 
87
		$(this).data('is_mouse_on_user_selector', false);
-
 
88
	});
-
 
89
 
58
});
90
});
59
91