| Line 417... |
Line 417... |
| 417 |
properties.source = String($(this).data('source'));
|
417 |
properties.source = String($(this).data('source'));
|
| 418 |
properties.url = encodeURIComponent($(this).data('url'));
|
418 |
properties.url = encodeURIComponent($(this).data('url'));
|
| 419 |
properties.price = String($(this).data('price'));
|
419 |
properties.price = String($(this).data('price'));
|
| 420 |
pma.send('products','url','click',me,properties);
|
420 |
pma.send('products','url','click',me,properties);
|
| 421 |
});
|
421 |
});
|
| 422 |
$('.jscroll-inner').on('click','.likedeal',function(e){
|
422 |
$('.jscroll-inner').on('click','.likeit',function(e){
|
| 423 |
var that = $(this);
|
423 |
var that = $(this);
|
| 424 |
if($(that).hasClass('active')){
|
424 |
if($(that).find('span.likedeal').hasClass('active')){
|
| 425 |
//User has already liked it,so remove like
|
425 |
//User has already liked it,so remove like
|
| 426 |
var url = apihost+"/user_actions/rem/"+me+"/"+$(this).data('id')+"/like";
|
426 |
var url = apihost+"/user_actions/rem/"+me+"/"+$(this).data('id')+"/like";
|
| 427 |
}else{
|
427 |
}else{
|
| 428 |
var url = apihost+"/user_actions/update/"+me+"/"+$(this).data('id')+"/like";
|
428 |
var url = apihost+"/user_actions/update/"+me+"/"+$(this).data('id')+"/like";
|
| 429 |
}
|
429 |
}
|
| Line 438... |
Line 438... |
| 438 |
format: "json"
|
438 |
format: "json"
|
| 439 |
},
|
439 |
},
|
| 440 |
// Work with the response
|
440 |
// Work with the response
|
| 441 |
success: function( response ) {
|
441 |
success: function( response ) {
|
| 442 |
if(response.success){
|
442 |
if(response.success){
|
| 443 |
$(that).toggleClass('active');
|
443 |
that.find('span.likedeal').toggleClass('active');
|
| 444 |
$(that).parent().find('li.dislikedeal',0).removeClass('active');
|
444 |
$(".img-overlay div[name='dislikediv_"+that.data('id')+"']").find('span.dislikedeal').removeClass('active');
|
| 445 |
}
|
445 |
}
|
| 446 |
}
|
446 |
}
|
| 447 |
});
|
447 |
});
|
| 448 |
ga('send', 'event', 'product', 'like', $(this).data('id'));
|
448 |
ga('send', 'event', 'product', 'like', $(this).data('id'));
|
| 449 |
var properties = {};
|
449 |
var properties = {};
|
| Line 469... |
Line 469... |
| 469 |
});
|
469 |
});
|
| 470 |
$('#myModal').modal('hide');
|
470 |
$('#myModal').modal('hide');
|
| 471 |
ga('send', 'event', 'brand', 'hide', $('#myModal').find('#productToHide',0).val());
|
471 |
ga('send', 'event', 'brand', 'hide', $('#myModal').find('#productToHide',0).val());
|
| 472 |
pma.send('brands','hide',$('#myModal').find('#productToHide',0).val(),me);
|
472 |
pma.send('brands','hide',$('#myModal').find('#productToHide',0).val(),me);
|
| 473 |
})
|
473 |
})
|
| 474 |
$('.jscroll-inner').on('click','.dislikedeal',function(e){
|
474 |
$('.jscroll-inner').on('click','.dislikeit',function(e){
|
| 475 |
var that = $(this);
|
475 |
var that = $(this);
|
| 476 |
if($(that).hasClass('active')){
|
476 |
if($(that).find('span.dislikedeal').hasClass('active')){
|
| 477 |
//User has already liked it,so remove like
|
477 |
//User has already liked it,so remove like
|
| 478 |
var url = apihost+"/user_actions/rem/"+me+"/"+$(this).data('id')+"/dislike";
|
478 |
var url = apihost+"/user_actions/rem/"+me+"/"+$(this).data('id')+"/dislike";
|
| 479 |
}else{
|
479 |
}else{
|
| 480 |
$('#myModal').find('#productToHide',0).val($(this).data('id'));
|
480 |
$('#myModal').find('#productToHide',0).val($(this).data('id'));
|
| 481 |
var url = apihost+"/user_actions/update/"+me+"/"+$(this).data('id')+"/dislike";
|
481 |
var url = apihost+"/user_actions/update/"+me+"/"+$(this).data('id')+"/dislike";
|
| Line 491... |
Line 491... |
| 491 |
format: "json"
|
491 |
format: "json"
|
| 492 |
},
|
492 |
},
|
| 493 |
// Work with the response
|
493 |
// Work with the response
|
| 494 |
success: function( response ) {
|
494 |
success: function( response ) {
|
| 495 |
if(response.success){
|
495 |
if(response.success){
|
| 496 |
$(that).toggleClass('active');
|
496 |
that.find('span.dislikedeal').toggleClass('active');
|
| 497 |
$(that).parent().find('li.likedeal',0).removeClass('active');
|
497 |
$(".img-overlay div[name='likediv_"+that.data('id')+"']").find('span.likedeal').removeClass('active');
|
| 498 |
}
|
498 |
}
|
| 499 |
}
|
499 |
}
|
| 500 |
});
|
500 |
});
|
| 501 |
ga('send', 'event', 'product', 'dislike', $(this).data('id'));
|
501 |
ga('send', 'event', 'product', 'dislike', $(this).data('id'));
|
| 502 |
var properties = {};
|
502 |
var properties = {};
|