FIX: Post height issues with table wrapper buttons

This commit is contained in:
Keegan George 2022-10-31 14:34:31 -07:00
parent b912bb955f
commit 8177dfab2a
No known key found for this signature in database
GPG Key ID: 91B40E38537AC000
2 changed files with 16 additions and 6 deletions

View File

@ -141,7 +141,8 @@ export default {
"open-popup-link",
"btn-default",
"btn",
"btn-icon-text"
"btn-icon-text",
"btn-expand-table"
);
const expandIcon = create(
iconNode("discourse-expand", { class: "expand-table-icon" })
@ -158,7 +159,7 @@ export default {
}
function generateModal(event) {
const table = event.target.nextElementSibling;
const table = event.target.parentElement.nextElementSibling;
const tempTable = table.cloneNode(true);
showModal("fullscreen-table").set("tableHtml", tempTable);
@ -176,8 +177,12 @@ export default {
const popupBtn = _createButton();
table.parentNode.classList.add("fullscreen-table-wrapper");
table.parentNode.insertBefore(popupBtn, table);
// Create a button wrapper for case of multiple buttons (i.e. table builder extension)
const buttonWrapper = document.createElement("div");
buttonWrapper.classList.add("fullscreen-table-wrapper-buttons");
buttonWrapper.append(popupBtn);
popupBtn.addEventListener("click", generateModal, false);
table.parentNode.insertBefore(buttonWrapper, table);
});
}

View File

@ -1652,16 +1652,21 @@ a.mention-group {
.open-popup-link {
position: sticky;
left: 0.5rem;
top: 0.5rem;
left: 1rem;
opacity: 0%;
white-space: nowrap;
display: block;
}
.fullscreen-table-wrapper {
transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
display: block;
position: relative;
&-buttons {
position: absolute;
top: 0.5rem;
left: 0.5rem;
}
}
.expand-table-icon {