diff --git a/static/enhance-content.js b/static/enhance-content.js index 4f109ca..9cf8c98 100644 --- a/static/enhance-content.js +++ b/static/enhance-content.js @@ -1,15 +1,8 @@ -import { WebComponent } from "web-component-base"; - -class EnhanceContent extends WebComponent { - static props = { - server: "", - tagUrl: "", - }; - - onInit() { +class EnhanceContent extends HTMLElement { + connectedCallback() { const el = this.getElementsByClassName("hashtag"); - const server = this.props.server; - const tagUrl = this.props.tagUrl; + const server = this.dataset.server; + const tagUrl = this.dataset.tagUrl; for (let i = 0; i < el.length; i++) { const tagEl = el.item(i); @@ -38,10 +31,6 @@ class EnhanceContent extends WebComponent { } } } - - get template() { - return this.innerHtml; - } } customElements.define("enhance-content", EnhanceContent); diff --git a/templates/card.html b/templates/card.html index f9cbf87..88e5f10 100644 --- a/templates/card.html +++ b/templates/card.html @@ -25,7 +25,7 @@