Subversion Repositories SmartDukaan

Rev

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

Rev 15019 Rev 15026
Line 527... Line 527...
527
		$(this).prop('checked',false);
527
		$(this).prop('checked',false);
528
	});	
528
	});	
529
});
529
});
530
$(document).on('click','.applyfilter',function(){	
530
$(document).on('click','.applyfilter',function(){	
531
	var brands = [];
531
	var brands = [];
-
 
532
	var brandnames = [];
532
	$('.filterbrand').each(function(){
533
	$('.filterbrand').each(function(){
533
		if($(this).prop('checked')){
534
		if($(this).prop('checked')){
-
 
535
			console.log($(this).parent().siblings('.brandname').html());
534
			brands.push($(this).val());
536
			brands.push($(this).val());
-
 
537
			brandnames.push($(this).parent().siblings('.brandname').html());
535
		}		
538
		}		
536
	});
539
	});
537
	if(brands.length==0){
540
	if(brands.length==0){
538
		$('#message').html('Please choose a few brands first').removeClass('hidden');
541
		$('#message').html('Please choose a few brands first').removeClass('hidden');
539
		setTimeout(function(){ $('#message').addClass('hidden'); }, 3000);
542
		setTimeout(function(){ $('#message').addClass('hidden'); }, 3000);
540
		return false;
543
		return false;
541
	}else{
544
	}else{
542
		var url = $('#brandselecter').prop('action');
545
		var url = $('#brandselecter').prop('action');
-
 
546
		ga('send', 'event', 'filter', 'brand', brandnames.join('|'));
543
		document.location = url+'&brands='+brands.join('^');
547
		document.location = url+'&brands='+brands.join('^');
544
	}	
548
	}	
545
});
549
});
546
$(document).on('click','#showallbrands',function(){	
550
$(document).on('click','#showallbrands',function(){	
547
	$('.hidden').removeClass('hidden');
551
	$('.hidden').removeClass('hidden');