DEV: Make it easier to customize link attributes in quick access menu (#11365)

This allows themes to customize link attributes:

```
api.reopenWidget("quick-access-item", {
  _linkAttributes(href) {
    const attributes = this._super(...arguments);
    // do stuff
    return attributes;
  }
}
```
This commit is contained in:
Gerhard Schlager 2020-11-27 12:26:47 +01:00 committed by GitHub
parent eeae657ca5
commit 2e5e4dbf19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,7 +44,7 @@ createWidget("quick-access-item", {
}
}
return h("a", { attributes: { href } }, [
return h("a", { attributes: this._linkAttributes(href) }, [
iconNode(icon),
new RawHtml({
html: `<div>${this._usernameHtml()}${content}</div>`,
@ -60,6 +60,10 @@ createWidget("quick-access-item", {
}
},
_linkAttributes(href) {
return { href };
},
_contentHtml() {
const content =
this.attrs.escapedContent || escapeExpression(this.attrs.content);