A platform for community discussion. Free, open, simple.
FIX: adds data-topic-id to quick-access-item (#8422)
Joffrey JAFFEUX700bd280e45d
diff --git a/app/assets/javascripts/discourse/widgets/quick-access-item.js.es6 b/app/assets/javascripts/discourse/widgets/quick-access-item.js.es6index a37200e5956..a9c27067694 100644--- a/app/assets/javascripts/discourse/widgets/quick-access-item.js.es6+++ b/app/assets/javascripts/discourse/widgets/quick-access-item.js.es6@@ -33,11 +33,19 @@ createWidget("quick-access-item", {return result;},- html({ icon, href }) {+ html({ href, icon }) {+ let content = this._contentHtml();++ let topicId = href.match(/\/t\/.*?\/(\d+)/);+ if (topicId && topicId[1]) {+ topicId = escapeExpression(topicId[1]);+ content = `<span data-topic-id="${topicId}">${content}</span>`;+ }+return h("a", { attributes: { href } }, [iconNode(icon),new RawHtml({- html: `<div>${this._usernameHtml()}${this._contentHtml()}</div>`+ html: `<div>${this._usernameHtml()}${content}</div>`})]);},