use a element instead of span for links

This commit is contained in:
Fran Jurmanović
2021-06-01 14:19:01 +02:00
parent 88661c5376
commit 123dc58fc3

View File

@@ -36,7 +36,8 @@ class AppLinkElement extends HTMLElement {
} }
} }
goTo = () => { goTo = (e: Event) => {
e.preventDefault();
if (!isTrue(this.goBack) && this.to) { if (!isTrue(this.goBack) && this.to) {
this.routerService.goTo(this.to); this.routerService.goTo(this.to);
} else { } else {
@@ -51,18 +52,19 @@ class AppLinkElement extends HTMLElement {
render = () => { render = () => {
return html`${this.disabled return html`${this.disabled
? html`<span ? html`<a
class="btn btn-link btn-disabled" class="btn btn-link btn-disabled"
data-target="app-link.main" data-target="app-link.main"
style="color:grey" style="color:grey"
>${this.title}</span >${this.title}</a
>` >`
: html`<span : html`<a
class="btn btn-link btn-disabled" class="btn btn-link btn-disabled"
data-target="app-link.main" data-target="app-link.main"
data-action="click:app-link#goTo" data-action="click:app-link#goTo"
href="${this.to}"
style="text-decoration: underline; cursor: pointer;" style="text-decoration: underline; cursor: pointer;"
>${this.title}</span >${this.title}</a
>`}`; >`}`;
}; };