diff --git a/client/ui/custom-elements/chat-file.ts b/client/ui/custom-elements/chat-file.ts index 4fea0eb..5eb0e94 100644 --- a/client/ui/custom-elements/chat-file.ts +++ b/client/ui/custom-elements/chat-file.ts @@ -7,16 +7,24 @@ customElements.define('chat-file', class extends HTMLElement { connectedCallback() { this.style.display = 'block' const e = new DOMParser().parseFromString(` -
+ -
`, 'text/html').body.firstChild as HTMLElement + `, 'text/html').body.firstChild as HTMLElement $(e).find('span').text($(this).attr("name")) const href = $(this).attr('href') + $(e).attr('href', href) + $(e).attr('target', '_blank') + $(e).attr('download', href) + e.style.textDecoration = 'none' + e.style.color = 'inherit' // deno-lint-ignore no-window - e.onclick = () => window.open(href, '_blank') + e.onclick = (e) => { + e.stopPropagation() + window.open(href, '_blank') + } this.appendChild(e) } })