| 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 |
$('.categorytab').on('click','.categorytabcontrol.active',function(){
|
| - |
|
8 |
$(this).toggleClass('active');
|
| - |
|
9 |
$('#preferences-'+$(this).data('id')).addClass('hidden');
|
| - |
|
10 |
$(this).parent().parent().children().find('.savecategorypreferences',0).removeClass('savecategorypreferences').addClass('editcategorypreferences').html('Edit').removeClass('btn-success');
|
| - |
|
11 |
});
|
| - |
|
12 |
$('.categorytab').on('click','.editcategorypreferences',function(e){
|
| - |
|
13 |
var that = $(this);
|
| - |
|
14 |
$(that).removeClass('editcategorypreferences').addClass('savecategorypreferences').html('Done').addClass('btn-success');
|
| - |
|
15 |
$('#togglepreferences-'+$(that).data('id')).toggleClass('active');
|
| - |
|
16 |
$('#preferences-'+$(that).data('id')).removeClass('hidden');
|
| - |
|
17 |
$('.brandselector').each(function(){
|
| - |
|
18 |
if($(this).data('catid')==$(that).data('id')){
|
| - |
|
19 |
$(this).addClass('active');
|
| - |
|
20 |
}
|
| - |
|
21 |
});
|
| - |
|
22 |
});
|
| - |
|
23 |
$('.categorytab').on('click','.savecategorypreferences',function(e){
|
| - |
|
24 |
var that = $(this);
|
| - |
|
25 |
$(that).removeClass('savecategorypreferences').addClass('editcategorypreferences').html('Edit').removeClass('btn-success');
|
| - |
|
26 |
$('#togglepreferences-'+$(that).data('id')).toggleClass('active');
|
| - |
|
27 |
$.ajax({
|
| - |
|
28 |
url: $('#categorypreference-'+$(that).data('id')).attr('action'),
|
| - |
|
29 |
data: $('#categorypreference-'+$(that).data('id')).serialize(),
|
| - |
|
30 |
// Tell jQuery we're expecting JSONP
|
| - |
|
31 |
dataType: "json",
|
| - |
|
32 |
// Tell YQL what we want and that we want JSON
|
| - |
|
33 |
method: 'post',
|
| - |
|
34 |
// Work with the response
|
| - |
|
35 |
success: function( response ) {
|
| - |
|
36 |
if(response.success){
|
| - |
|
37 |
$('#preferences-'+$(that).data('id')).addClass('hidden');
|
| - |
|
38 |
}
|
| - |
|
39 |
}
|
| - |
|
40 |
});
|
| - |
|
41 |
ga('send', 'event', 'preferences', 'update', me);
|
| - |
|
42 |
});
|
| 7 |
$('.row').on('click','.viewproduct',function(e){
|
43 |
$('.row').on('click','.viewproduct',function(e){
|
| 8 |
$('#loadingModal').modal();
|
44 |
$('#loadingModal').modal();
|
| 9 |
var url = apihost+"clicks/add/"+me+"/"+$(this).data('id');
|
45 |
var url = apihost+"clicks/add/"+me+"/"+$(this).data('id');
|
| 10 |
$.ajax({
|
46 |
$.ajax({
|
| 11 |
url: url,
|
47 |
url: url,
|