Subversion Repositories SmartDukaan

Rev

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

Rev 20714 Rev 20715
Line 464... Line 464...
464
    
464
    
465
$(document).on('stopdrag', '.viewproduct', function() {
465
$(document).on('stopdrag', '.viewproduct', function() {
466
  clearClickActionTimeout();
466
  clearClickActionTimeout();
467
});    
467
});    
468
    $(document).on('click','.viewproduct',function(e){
468
    $(document).on('click','.viewproduct',function(e){
-
 
469
    var that = this;
469
  	clearClickActionTimeout();
470
  	clearClickActionTimeout();
470
  	clickActionTimeout = setTimeout(function() {
471
  	clickActionTimeout = setTimeout(function() {
471
    localStorage.pages = $('div.scrollselector').html();
472
    localStorage.pages = $('div.scrollselector').html();
472
		setCookie('fresh', "0", .1, true);
473
		setCookie('fresh', "0", .1, true);
473
        var proid = $(this).data("proid");
474
        var proid = $(that).data("proid");
474
        var identifier = $(this).data("identifier");
475
        var identifier = $(that).data("identifier");
475
        
476
        
476
        if(typeof livePriceCalls != undefined) {
477
        if(typeof livePriceCalls != undefined) {
477
            for(var i in livePriceCalls){
478
            for(var i in livePriceCalls){
478
                livePriceCalls[i].abort();
479
                livePriceCalls[i].abort();
479
            }
480
            }
480
        }
481
        }
481
        $('#loadingModal').modal();
482
        $('#loadingModal').modal();
482
        var store = $(this).data('source');
483
        var store = $(that).data('source');
483
        var url = apihost+"clicks/add/"+me+"/"+$(this).data('id')+'/'+$(this).data('source')+'/?url='+encodeURIComponent($(this).data('url'))+'&price='+$(this).data('price');
484
        var url = apihost+"clicks/add/"+me+"/"+$(that).data('id')+'/'+$(that).data('source')+'/?url='+encodeURIComponent($(that).data('url'))+'&price='+$(that).data('price');
484
        $.ajax({
485
        $.ajax({
485
            url: url,
486
            url: url,
486
            // The name of the callback parameter, as specified by the YQL service
487
            // The name of the callback parameter, as specified by the YQL service
487
            jsonp: "callback",
488
            jsonp: "callback",
488
            // Tell jQuery we're expecting JSONP
489
            // Tell jQuery we're expecting JSONP
Line 549... Line 550...
549
            },
550
            },
550
            error: function() {
551
            error: function() {
551
                document.location = url;
552
                document.location = url;
552
            }
553
            }
553
        });
554
        });
554
        ga('send', 'event', 'product', 'click', $(this).data('url'));
555
        ga('send', 'event', 'product', 'click', $(that).data('url'));
555
        var properties = {};
556
        var properties = {};
556
        properties.sku = String($(this).data('id'));
557
        properties.sku = String($(that).data('id'));
557
        properties.source = String($(this).data('source'));
558
        properties.source = String($(that).data('source'));
558
        properties.url = encodeURIComponent($(this).data('url'));
559
        properties.url = encodeURIComponent($(that).data('url'));
559
        properties.price = String($(this).data('price'));
560
        properties.price = String($(that).data('price'));
560
        pma.send('products','url','click',me,properties);
561
        pma.send('products','url','click',me,properties);
561
  		}, 200);
562
  		}, 200);
562
    });
563
    });
563
    $(document).on('click','.likeit',function(e){   
564
    $(document).on('click','.likeit',function(e){   
564
        var that = $(this);
565
        var that = $(this);