Skip to content

A platform for community discussion. Free, open, simple.

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

Gerhard Schlager2e5e4dbf1933
diff --git a/app/assets/javascripts/discourse/app/widgets/quick-access-item.js b/app/assets/javascripts/discourse/app/widgets/quick-access-item.js
index fb2a1db1f54..f21fbf971b4 100644
--- a/app/assets/javascripts/discourse/app/widgets/quick-access-item.js
+++ b/app/assets/javascripts/discourse/app/widgets/quick-access-item.js
@@ -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);