Merge pull request #1485 from bookwyrm-social/notifications

Refactors notifications templates
This commit is contained in:
Mouse Reeve
2021-10-02 11:41:18 -07:00
committed by GitHub
16 changed files with 531 additions and 164 deletions

View File

@ -0,0 +1,21 @@
/* exported BlockHref */
let BlockHref = new class {
constructor() {
document.querySelectorAll('[data-href]')
.forEach(t => t.addEventListener('click', this.followLink.bind(this)));
}
/**
* Follow a fake link
*
* @param {Event} event
* @return {undefined}
*/
followLink(event) {
const url = event.currentTarget.dataset.href;
window.location.href = url;
}
}();