table
This commit is contained in:
@@ -254,6 +254,27 @@
|
||||
}
|
||||
});
|
||||
|
||||
editor.on('component:click', (model, evt) => {
|
||||
if (!model || !evt || !evt.target) return;
|
||||
const target = evt.target.closest && evt.target.closest('td,th');
|
||||
if (!target) return;
|
||||
const tableEl = target.closest && target.closest('table');
|
||||
if (!tableEl || tableEl.getAttribute('data-bridge-table') !== '1') return;
|
||||
const id = target.getAttribute('id');
|
||||
if (id && editor.getWrapper && editor.getWrapper().find) {
|
||||
const found = editor.getWrapper().find(`#${id}`);
|
||||
if (found && found[0]) {
|
||||
editor.select(found[0]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
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);
|
||||
}
|
||||
});
|
||||
|
||||
editor.on('component:dblclick', (model) => {
|
||||
if (isBridgeTableComponent(model)) {
|
||||
openTableModal(model);
|
||||
|
||||
Reference in New Issue
Block a user