From 9ce1cb7086a2af41d76a29043e40e0bc332890a7 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Mon, 9 Feb 2026 00:37:25 +0100 Subject: [PATCH] table --- config/current.ver | 2 +- public/assets/js/bridge/table-builder.js | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/config/current.ver b/config/current.ver index 7000921..101bb3a 100644 --- a/config/current.ver +++ b/config/current.ver @@ -1 +1 @@ -1.2.83 +1.2.84 diff --git a/public/assets/js/bridge/table-builder.js b/public/assets/js/bridge/table-builder.js index c264838..4d6d8db 100644 --- a/public/assets/js/bridge/table-builder.js +++ b/public/assets/js/bridge/table-builder.js @@ -209,6 +209,8 @@ return attrs && attrs['data-bridge-table'] === '1'; }; + let lastClickedCellComp = null; + if (editor.Commands && editor.Commands.add) { editor.Commands.add('bridge-table:edit', { run(ed, sender, opts = {}) { @@ -224,6 +226,10 @@ editor.on('component:selected', (model) => { if (!model) return; if (model.get && model.get('tagName') === 'tr') { + if (lastClickedCellComp) { + editor.select(lastClickedCellComp); + return; + } const parent = model.parent && model.parent(); const table = parent && (parent.get && parent.get('tagName') === 'table' ? parent : parent.parent && parent.parent()); if (isBridgeTableComponent(table)) { @@ -260,10 +266,19 @@ if (!target) return; const tableEl = target.closest && target.closest('table'); if (!tableEl || tableEl.getAttribute('data-bridge-table') !== '1') return; + const comp = editor.DomComponents && editor.DomComponents.getComponent + ? editor.DomComponents.getComponent(target) + : null; + if (comp) { + lastClickedCellComp = comp; + editor.select(comp); + return; + } const id = target.getAttribute('id'); if (id && editor.getWrapper && editor.getWrapper().find) { const found = editor.getWrapper().find(`#${id}`); if (found && found[0]) { + lastClickedCellComp = found[0]; editor.select(found[0]); return; } @@ -271,7 +286,10 @@ if (model.get && model.get('tagName') === 'tr') { const cells = model.components && model.components(); const firstCell = cells && cells.length ? cells.at(0) : null; - if (firstCell) editor.select(firstCell); + if (firstCell) { + lastClickedCellComp = firstCell; + editor.select(firstCell); + } } });