Fixed CSS for the "Send to chat" feature

This commit is contained in:
Vlyan
2021-08-04 19:35:41 +02:00
parent 0116497921
commit 56ab2cfb34
4 changed files with 48 additions and 6 deletions

View File

@@ -490,11 +490,13 @@ export class HelpersL5r5e {
* @return {Promise<*>}
*/
static async sendToChat(object) {
// Get the html
const tpl = await object.renderTextTemplate();
if (!tpl) {
return;
}
// Create the link
let link = null;
if (object.data.flags.core?.sourceId) {
link = object.data.flags.core?.sourceId.replace(/(\w+)\.(.+)/, "@$1[$2]");
@@ -504,8 +506,9 @@ export class HelpersL5r5e {
link = object.link;
}
// Send to Chat
return ChatMessage.create({
content: (link ? link + `<br>` : "") + tpl,
content: `<div class="l5r5e-chat-item">${tpl}${link ? `<hr>` + link : ""}</div>`,
});
}
}