weblink target (#3431)

This commit is contained in:
Paulus Schoutsen 2019-07-26 15:09:32 -07:00 committed by GitHub
parent 54ea6176aa
commit dcfed5d7e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,7 +37,10 @@ class HuiWeblinkRow extends LitElement implements EntityRow {
}
return html`
<a href="${this._config.url}" target="_blank">
<a
href=${this._config.url}
target=${this._config.url.indexOf("://") !== -1 ? "_blank" : ""}
>
<ha-icon .icon="${this._config.icon}"></ha-icon>
<div>${this._config.name}</div>
</a>