Documentation

This commit is contained in:
Joachim 2021-11-28 22:10:15 +01:00
parent 9ec4ad6b31
commit 84b5c2da4e

View file

@ -375,8 +375,16 @@ let BookWyrm = new class {
}
}
handleModalButton(element) {
const modalButton = element.currentTarget;
/**
* Handle the modal component.
*
* @param {Event} event - Event fired by an element
* with the `data-modal-open` attribute
* pointing to a modal by its id.
* @return {undefined}
*/
handleModalButton(event) {
const modalButton = event.currentTarget;
const targetModalId = modalButton.dataset.modalOpen;
const htmlElement = document.querySelector('html');
const modal = document.getElementById(targetModalId);