// Book modal
- const $bookModal = document.getElementById('bookModal');
- const $bookModalCloseButtons = getAll('.bd-book-modal-close');
-
- if (!cookieBookModal) {
- setTimeout(() => {
- openModal('bookModal');
- }, 5000);
- }
-
- if ($bookModalCloseButtons.length > 0) {
- $bookModalCloseButtons.forEach($el => {
- $el.addEventListener('click', event => {
- event.stopPropagation();
- Cookies.set(cookieBookModalName, true, { expires: 30 });
- });
- });
- }
+ // const $bookModal = document.getElementById('bookModal');
+ // const $bookModalCloseButtons = getAll('.bd-book-modal-close');
+
+ // if (!cookieBookModal) {
+ // setTimeout(() => {
+ // openModal('bookModal');
+ // }, 5000);
+ // }
+
+ // if ($bookModalCloseButtons.length > 0) {
+ // $bookModalCloseButtons.forEach($el => {
+ // $el.addEventListener('click', event => {
+ // event.stopPropagation();
+ // Cookies.set(cookieBookModalName, true, { expires: 30 });
+ // });
+ // });
+ // }
// Meta links
});
}
+ document.addEventListener('keydown', event => {
+ const e = event || window.event;
+ if (e.keyCode === 27) {
+ closeModals();
+ closeDropdowns();
+ }
+ });
+
// Clipboard
const $highlights = getAll('.highlight');
// Book modal
- var $bookModal = document.getElementById('bookModal');
- var $bookModalCloseButtons = getAll('.bd-book-modal-close');
-
- if (!cookieBookModal) {
- setTimeout(function () {
- openModal('bookModal');
- }, 5000);
- }
-
- if ($bookModalCloseButtons.length > 0) {
- $bookModalCloseButtons.forEach(function ($el) {
- $el.addEventListener('click', function (event) {
- event.stopPropagation();
- Cookies.set(cookieBookModalName, true, { expires: 30 });
- });
- });
- }
+ // const $bookModal = document.getElementById('bookModal');
+ // const $bookModalCloseButtons = getAll('.bd-book-modal-close');
+
+ // if (!cookieBookModal) {
+ // setTimeout(() => {
+ // openModal('bookModal');
+ // }, 5000);
+ // }
+
+ // if ($bookModalCloseButtons.length > 0) {
+ // $bookModalCloseButtons.forEach($el => {
+ // $el.addEventListener('click', event => {
+ // event.stopPropagation();
+ // Cookies.set(cookieBookModalName, true, { expires: 30 });
+ // });
+ // });
+ // }
// Meta links
});
}
+ document.addEventListener('keydown', function (event) {
+ var e = event || window.event;
+ if (e.keyCode === 27) {
+ closeModals();
+ closeDropdowns();
+ }
+ });
+
// Clipboard
var $highlights = getAll('.highlight');