Subversion Repositories SmartDukaan

Rev

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

Rev 13722 Rev 13731
Line 141... Line 141...
141
				}
141
				}
142
			}
142
			}
143
		});
143
		});
144
		ga('send', 'event', 'product', 'dislike', $(this).data('id'));
144
		ga('send', 'event', 'product', 'dislike', $(this).data('id'));
145
	});
145
	});
-
 
146
	$('.deletefav').on('click',function(){
-
 
147
		var that = $(this);
-
 
148
		$('#loadingModal').modal();
-
 
149
		var url = apihost+"/user_actions/deletefav/"+me+"/"+$(this).data('id');			
-
 
150
		$.ajax({
-
 
151
			url: url,
-
 
152
			// The name of the callback parameter, as specified by the YQL service
-
 
153
			jsonp: "callback",
-
 
154
			// Tell jQuery we're expecting JSONP
-
 
155
			dataType: "jsonp",
-
 
156
			// Tell YQL what we want and that we want JSON
-
 
157
			data: {
-
 
158
				format: "json"
-
 
159
			},
-
 
160
			// Work with the response
-
 
161
			success: function( response ) {
-
 
162
				$('#loadingModal').modal('hide');
-
 
163
				if(response.success){			
-
 
164
					$('#fav-'+$(that).data('id')).hide('slow');
-
 
165
				}
-
 
166
			}
-
 
167
		});
-
 
168
		ga('send', 'event', 'favourites', 'remove', $(this).data('id'));
-
 
169
	});
-
 
170
	$('.clearfavs').on('click',function(){
-
 
171
		var that = $(this);
-
 
172
		$('#loadingModal').modal();
-
 
173
		var url = apihost+"/user_actions/deleteallfavs/"+me;			
-
 
174
		$.ajax({
-
 
175
			url: url,
-
 
176
			// The name of the callback parameter, as specified by the YQL service
-
 
177
			jsonp: "callback",
-
 
178
			// Tell jQuery we're expecting JSONP
-
 
179
			dataType: "jsonp",
-
 
180
			// Tell YQL what we want and that we want JSON
-
 
181
			data: {
-
 
182
				format: "json"
-
 
183
			},
-
 
184
			// Work with the response
-
 
185
			success: function( response ) {
-
 
186
				$('#loadingModal').modal('hide');
-
 
187
				if(response.success){			
-
 
188
					$('.deletefav').each(function(){
-
 
189
						$('#fav-'+$(this).data('id')).hide('slow');
-
 
190
					})					
-
 
191
				}
-
 
192
				$(that).hide();
-
 
193
			}
-
 
194
		});
-
 
195
		ga('send', 'event', 'favourites', 'removeall', me);
-
 
196
	});
146
});
197
});
147
198