2021-10-02 18:24:07 +00:00
|
|
|
/* exported BlockHref */
|
|
|
|
|
2021-12-16 18:53:38 +00:00
|
|
|
let BlockHref = new (class {
|
2021-10-02 18:24:07 +00:00
|
|
|
constructor() {
|
2021-12-16 18:53:38 +00:00
|
|
|
document
|
|
|
|
.querySelectorAll("[data-href]")
|
|
|
|
.forEach((t) => t.addEventListener("click", this.followLink.bind(this)));
|
2021-10-02 18:24:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Follow a fake link
|
|
|
|
*
|
|
|
|
* @param {Event} event
|
|
|
|
* @return {undefined}
|
|
|
|
*/
|
|
|
|
followLink(event) {
|
|
|
|
const url = event.currentTarget.dataset.href;
|
|
|
|
|
|
|
|
window.location.href = url;
|
|
|
|
}
|
2021-12-16 18:53:38 +00:00
|
|
|
})();
|