Verified Commit a5e812da authored by Laurent Heirendt's avatar Laurent Heirendt
Browse files

WIP add ids of checkboxes

parent 037a8d9b
......@@ -118,16 +118,21 @@ function accept() {
// style
$('.lap-cookies-accept').addClass('selected');
$('.lap-cookies-refuse').removeClass('selected');
$('input#checkbox-2')[0].checked = true;
}
var boxID = 2;
$('input#checkbox-' + boxID)[0].checked = true;
}
function select_accept() {
if ($('input#checkbox-2')[0].checked === true) {
/*
* toggleBox: refuse/accept based on checkbox with boxID
*/
function toggleBox(boxID) {
if ($('input#checkbox-' + boxID)[0].checked === true) {
refuse(false);
} else {
accept();
}
hideBanner();
}
/*
......@@ -149,7 +154,9 @@ function refuse(doNotTrack) {
// style
$('.lap-cookies-refuse').addClass('selected');
$('.lap-cookies-accept').removeClass('selected');
$('input#checkbox-2')[0].checked = false;
var boxID = 2;
$('input#checkbox-' + boxID)[0].checked = false;
}
/*
......@@ -172,8 +179,7 @@ $(document).ready(function() {
$('.analytics').click(function(e) {
e.preventDefault(true);
select_accept();
hideBanner();
toggleBox(2);
});
// detect if the visitor is a bot or not
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment