Subversion Repositories SmartDukaan

Rev

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

Rev 13583 Rev 13599
Line 2... Line 2...
2
	$('.scroll').jscroll({
2
	$('.scroll').jscroll({
3
		loadingHtml: '<center><img src="/img/ajax-loader.gif" alt="Loading" /></center>',
3
		loadingHtml: '<center><img src="/img/ajax-loader.gif" alt="Loading" /></center>',
4
	    autoTriggerUntil: 3,
4
	    autoTriggerUntil: 3,
5
	    padding: 20,
5
	    padding: 20,
6
	});
6
	});
7
	$('.scroll').on('click','.viewproduct',function(e){
7
	$('.row').on('click','.viewproduct',function(e){
8
		var url = apihost+"clicks/add/"+me+"/"+$(this).data('id');
8
		var url = apihost+"clicks/add/"+me+"/"+$(this).data('id');
9
		$.ajax({
9
		$.ajax({
10
			url: url,
10
			url: url,
11
			// The name of the callback parameter, as specified by the YQL service
11
			// The name of the callback parameter, as specified by the YQL service
12
			jsonp: "callback",
12
			jsonp: "callback",
Line 22... Line 22...
22
					document.location = response.url;
22
					document.location = response.url;
23
				}
23
				}
24
			}
24
			}
25
		});
25
		});
26
	});
26
	});
27
	$('.scroll').on('click','.likedeal',function(e){		
27
	$('.row').on('click','.likedeal',function(e){		
28
		var that = $(this);
28
		var that = $(this);
29
		if($(that).find('.btn',0).hasClass('active')){
29
		if($(that).find('.btn',0).hasClass('active')){
30
			//User has already liked it,so remove like
30
			//User has already liked it,so remove like
31
			var url = apihost+"/user_actions/rem/"+me+"/"+$(this).data('id')+"/like";	
31
			var url = apihost+"/user_actions/rem/"+me+"/"+$(this).data('id')+"/like";	
32
		}else{
32
		}else{
Line 49... Line 49...
49
					$(that).parent().find('li.dislikedeal',0).find('.btn',0).removeClass('active');
49
					$(that).parent().find('li.dislikedeal',0).find('.btn',0).removeClass('active');
50
				}
50
				}
51
			}
51
			}
52
		});
52
		});
53
	});
53
	});
54
	$('.scroll').on('click','.dislikedeal',function(e){		
54
	$('.row').on('click','.dislikedeal',function(e){		
55
		var that = $(this);
55
		var that = $(this);
56
		if($(that).find('.btn',0).hasClass('active')){
56
		if($(that).find('.btn',0).hasClass('active')){
57
			//User has already liked it,so remove like
57
			//User has already liked it,so remove like
58
			var url = apihost+"/user_actions/rem/"+me+"/"+$(this).data('id')+"/dislike";	
58
			var url = apihost+"/user_actions/rem/"+me+"/"+$(this).data('id')+"/dislike";	
59
		}else{
59
		}else{
Line 76... Line 76...
76
					$(that).parent().find('li.likedeal',0).find('.btn',0).removeClass('active');
76
					$(that).parent().find('li.likedeal',0).find('.btn',0).removeClass('active');
77
				}
77
				}
78
			}
78
			}
79
		});
79
		});
80
	});
80
	});
81
});
-
 
82
81
});
-
 
82