18 lines
550 B
JavaScript
18 lines
550 B
JavaScript
|
// Right-click button handler, to dissuade downloading.
|
||
|
document.addEventListener('DOMContentLoaded', () => {
|
||
|
const $modal = document.querySelector("#rightclick-modal"),
|
||
|
$button = $modal.querySelector("button"),
|
||
|
cls = 'is-active';
|
||
|
|
||
|
console.log("register right clicks");
|
||
|
console.log($modal, $button);
|
||
|
|
||
|
document.addEventListener('contextmenu', (e) => {
|
||
|
$modal.classList.add(cls);
|
||
|
e.preventDefault();
|
||
|
});
|
||
|
$button.addEventListener('click', () => {
|
||
|
$modal.classList.remove(cls);
|
||
|
});
|
||
|
});
|