mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 17:40:43 +08:00
FIX: Inline footnotes doesn’t work in the table at fullscreen (#27686)
* FIX: Inline footnotes doesn’t work in the table at fullscreen meta topic: https://meta.discourse.org/t/inline-footnotes-doesnt-work-in-the-table-at-fullscreen/313445
This commit is contained in:
@ -65,7 +65,13 @@ function footnoteEventHandler(event) {
|
||||
|
||||
// append footnote to tooltip body
|
||||
const footnoteContent = tooltip.querySelector(".footnote-tooltip-content");
|
||||
const cooked = expandableFootnote.closest(".cooked");
|
||||
let cooked = expandableFootnote.closest(".cooked");
|
||||
if (cooked.dataset.refPostId != null) {
|
||||
// For full screen tables, redirect
|
||||
cooked = document.querySelector(
|
||||
`article[data-post-id="${cooked.dataset.refPostId}"] .cooked`
|
||||
);
|
||||
}
|
||||
const newContent = cooked.querySelector(footnoteId);
|
||||
footnoteContent.innerHTML = newContent.innerHTML;
|
||||
|
||||
@ -107,7 +113,7 @@ export default {
|
||||
}
|
||||
|
||||
document.body.append(buildTooltip());
|
||||
window.addEventListener("click", footnoteEventHandler);
|
||||
window.addEventListener("click", footnoteEventHandler, true);
|
||||
|
||||
withPluginApi("0.8.9", (api) => {
|
||||
api.decorateCookedElement((elem) => applyInlineFootnotes(elem), {
|
||||
|
@ -45,7 +45,7 @@
|
||||
font-size: var(--font-down-1);
|
||||
border-radius: 3px;
|
||||
display: none;
|
||||
z-index: z("tooltip");
|
||||
z-index: z("modal", "tooltip");
|
||||
max-width: 400px;
|
||||
overflow-wrap: break-word;
|
||||
|
||||
|
Reference in New Issue
Block a user