-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathscripts.js
executable file
·39 lines (34 loc) · 1.33 KB
/
scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
document.addEventListener('DOMContentLoaded', () => {
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
if ($navbarBurgers.length > 0) {
$navbarBurgers.forEach(($el) => {
$el.addEventListener('click', () => {
const target = $el.dataset.target;
const $target = document.getElementById(target);
$el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
});
}
});
(function (window, document) {
function onDocumentReady(fn) {
if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading") {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
onDocumentReady(function () {
// If you pass `?without-details` to an URL, it will automatically open
// the `<details>` blocks (i.e. the Q&A sections most of the time).
if (window.location.search.match(/\?without-details/gi)) {
// Loop over all the `<blockquote>` tags and hide them.
var blockquote = document.querySelectorAll('.details');
Array.prototype.forEach.call(blockquote, function (blockquote) {
blockquote.innerHTML = '';
blockquote.style.display = 'none';
});
}
});
})(window, document);