mirror of
https://github.com/discourse/discourse-table-builder.git
synced 2026-09-18 07:42:13 -04:00
FIX: Post height issues (#34)
This commit is contained in:
@@ -59,13 +59,21 @@ export default apiInitializer("0.11.1", (api) => {
|
||||
if (table.parentNode.contains(expandBtn)) {
|
||||
expandBtn.parentNode.insertBefore(popupBtn, expandBtn);
|
||||
} else {
|
||||
table.parentNode.insertBefore(popupBtn, table);
|
||||
const buttonWrapper = document.createElement("div");
|
||||
buttonWrapper.classList.add("fullscreen-table-wrapper--buttons");
|
||||
buttonWrapper.append(popupBtn);
|
||||
table.parentNode.insertBefore(buttonWrapper, table);
|
||||
}
|
||||
|
||||
popupBtn.addEventListener("click", generateModal.bind(attrs), false);
|
||||
});
|
||||
}
|
||||
|
||||
function cleanupPopupBtns() {
|
||||
const popupBtns = document.querySelectorAll("button.open-popup-link");
|
||||
popupBtns.forEach((btn) => btn.removeEventListener("click", generateModal));
|
||||
}
|
||||
|
||||
api.decorateCookedElement(
|
||||
(post, helper) => {
|
||||
const canEdit = helper.widget.attrs.canEdit;
|
||||
@@ -84,4 +92,6 @@ export default apiInitializer("0.11.1", (api) => {
|
||||
id: "edit-table",
|
||||
}
|
||||
);
|
||||
|
||||
api.cleanupStream(cleanupPopupBtns);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user