hakyll-skeleton/js/script.js
Fiscal Velvet Poet c28e591961
Initial commit
2021-11-04 19:23:31 +10:00

16 lines
454 B
JavaScript

(function(document) {
var toggle = document.querySelector('.sidebar-toggle');
var sidebar = document.querySelector('#sidebar');
var checkbox = document.querySelector('#sidebar-checkbox');
document.addEventListener('click', function(e) {
var target = e.target;
if(!checkbox.checked ||
sidebar.contains(target) ||
(target === checkbox || target === toggle)) return;
checkbox.checked = false;
}, false);
})(document);