From 84b5c2da4eec9eaace8a1bc4bc0ae69c8799feef Mon Sep 17 00:00:00 2001 From: Joachim Date: Sun, 28 Nov 2021 22:10:15 +0100 Subject: [PATCH] Documentation --- bookwyrm/static/js/bookwyrm.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bookwyrm/static/js/bookwyrm.js b/bookwyrm/static/js/bookwyrm.js index 4a2f882c0..352bb7c7b 100644 --- a/bookwyrm/static/js/bookwyrm.js +++ b/bookwyrm/static/js/bookwyrm.js @@ -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);