mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 17:56:16 +08:00
FIX: adds data-topic-id to quick-access-item (#8430)
This fix will allow discourse-encrypt to decrypt messages titles of the quick-access-pannel for PMs
This commit is contained in:
parent
7fc99f5e7b
commit
e92e06c3a7
|
@ -33,11 +33,21 @@ createWidget("quick-access-item", {
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
html({ icon, href }) {
|
html({ href, icon }) {
|
||||||
|
let content = this._contentHtml();
|
||||||
|
|
||||||
|
if (href) {
|
||||||
|
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 } }, [
|
return h("a", { attributes: { href } }, [
|
||||||
iconNode(icon),
|
iconNode(icon),
|
||||||
new RawHtml({
|
new RawHtml({
|
||||||
html: `<div>${this._usernameHtml()}${this._contentHtml()}</div>`
|
html: `<div>${this._usernameHtml()}${content}</div>`
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user