mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 04:42:55 +08:00
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:
parent
eeae657ca5
commit
2e5e4dbf19
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user