Remove book modal

This commit is contained in:
Jeremy Thomas 2018-04-08 19:54:36 +01:00
parent a76c16b387
commit c63b57b58d
2 changed files with 46 additions and 30 deletions

View File

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

View File

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