From fbbf78d99bf53038249d9bbd653b23a542a34124 Mon Sep 17 00:00:00 2001 From: Keegan George Date: Wed, 20 Jul 2022 16:28:43 -0700 Subject: [PATCH] FIX: Expand button not working on multiple tables in post --- javascripts/discourse/api-initializers/table-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascripts/discourse/api-initializers/table-editor.js b/javascripts/discourse/api-initializers/table-editor.js index 2694388..fb0d2a4 100644 --- a/javascripts/discourse/api-initializers/table-editor.js +++ b/javascripts/discourse/api-initializers/table-editor.js @@ -54,7 +54,7 @@ export default apiInitializer("0.11.1", (api) => { const popupBtn = createButton(); popupBtn.setAttribute("data-table-id", index); // sets a table id so each table can be distinctly edited table.parentNode.classList.add("fullscreen-table-wrapper"); - const expandBtn = document.querySelector(".open-popup-link"); + const expandBtn = table.parentNode.querySelector(".open-popup-link"); if (table.parentNode.contains(expandBtn)) { expandBtn.parentNode.insertBefore(popupBtn, expandBtn);