Skip to content

Commit 35e5e29

Browse files
committed
add pause for css waiting
1 parent ff0bc12 commit 35e5e29

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

js/cookie-notify.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ $(document).ready(function() {
1212
var matches = document.cookie.match(new RegExp("(?:^|; )agree_to_use=([^;]*)"));
1313
var agreeToUseCookie = matches && decodeURIComponent(matches[1]);
1414
if (!agreeToUseCookie) {
15-
$('body').append(template);
16-
$('.agree-using-cookies').on('click', function() {
17-
var date = new Date();
18-
date.setFullYear(date.getFullYear() + 2); // + 2 years
19-
document.cookie = 'agree_to_use=' + Date.now() + '; path=/; expires=' + date.toUTCString();
20-
$('#cookie-notification').hide();
21-
return false;
22-
});
15+
setTimeout(function() {
16+
$('body').append(template);
17+
$('.agree-using-cookies').on('click', function() {
18+
var date = new Date();
19+
date.setFullYear(date.getFullYear() + 2); // + 2 years
20+
document.cookie = 'agree_to_use=' + Date.now() + '; path=/; expires=' + date.toUTCString();
21+
$('#cookie-notification').hide();
22+
return false;
23+
});
24+
}, 200);
2325
}
2426
});

0 commit comments

Comments
 (0)