| | |
| | | }) |
| | | } |
| | | |
| | | const hasAlreadyBeenFetched = () => |
| | | [...link.children].some((child) => child.classList.contains("popover")) |
| | | |
| | | // dont refetch if there's already a popover |
| | | if ([...link.children].some((child) => child.classList.contains("popover"))) { |
| | | if (hasAlreadyBeenFetched()) { |
| | | return setPosition(link.lastChild as HTMLElement) |
| | | } |
| | | |
| | |
| | | console.error(err) |
| | | }) |
| | | |
| | | // bailout if another popover exists |
| | | if (hasAlreadyBeenFetched()) { |
| | | return |
| | | } |
| | | |
| | | if (!contents) return |
| | | const html = p.parseFromString(contents, "text/html") |
| | | normalizeRelativeURLs(html, targetUrl) |