Subversion Repositories SmartDukaan

Rev

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

Rev 15583 Rev 15584
Line 570... Line 570...
570
	});	
570
	});	
571
	ga('send', 'event', 'filter', 'brand', 'reset');
571
	ga('send', 'event', 'filter', 'brand', 'reset');
572
	pma.send('filters','brands','reset',me);
572
	pma.send('filters','brands','reset',me);
573
});
573
});
574
$(document).on('click','.applyfilter',function(){	
574
$(document).on('click','.applyfilter',function(){	
-
 
575
	$(this).prop('disabled',true);
-
 
576
	$('#loadingModal').modal();
575
	var brands = [];
577
	var brands = [];
576
	var brandnames = [];
578
	var brandnames = [];
577
	$('.filterbrand').each(function(){
579
	$('.filterbrand').each(function(){
578
		if($(this).prop('checked')){
580
		if($(this).prop('checked')){
579
			brands.push($(this).val());
581
			brands.push($(this).val());
Line 593... Line 595...
593
			properties['brand_'+i] = brandnames[i];
595
			properties['brand_'+i] = brandnames[i];
594
		}
596
		}
595
		pma.send('filters','brands','addfilter',me,properties);
597
		pma.send('filters','brands','addfilter',me,properties);
596
		var postdata = {'user_id':me,'type':'brand','filters':brandnames.join('|')};
598
		var postdata = {'user_id':me,'type':'brand','filters':brandnames.join('|')};
597
		$.post( "/user_filters/add", postdata, function( data ) {
599
		$.post( "/user_filters/add", postdata, function( data ) {
-
 
600
			$('#loadingModal').modal('hide');
598
		  document.location = url+'&brands='+brands.join('^');
601
	  		document.location = url+'&brands='+brands.join('^');
599
		});		
602
		});		
600
	}	
603
	}	
601
});
604
});
602
$(document).on('click','#showallbrands',function(){	
605
$(document).on('click','#showallbrands',function(){	
603
	$('.hidden').removeClass('hidden');
606
	$('.hidden').removeClass('hidden');
Line 804... Line 807...
804
    }
807
    }
805
}
808
}
806
 
809
 
807
 
810
 
808
var pma = new function() {
811
var pma = new function() {
809
    // this.apiurl = "http://45.33.50.227:8081/";
812
    this.apiurl = "http://45.33.50.227:8081/";
810
    this.apiurl = "http://127.0.0.1:8081/";
813
    // this.apiurl = "http://127.0.0.1:8081/";
811
    this.endpoints = {'identify':'identify','profile':'profile','track':'track'};
814
    this.endpoints = {'identify':'identify','profile':'profile','track':'track'};
812
 
815
 
813
    this.send = function (category,action,label,user_id,properties) {
816
    this.send = function (category,action,label,user_id,properties) {
814
 		$.ajax({
817
 		$.ajax({
815
			url: this.apiurl + this.endpoints.track,
818
			url: this.apiurl + this.endpoints.track,