Как создать это выделение с помощью JS или TinyMCE ⇐ CSS

Разбираемся в CSS
Гость
Как создать это выделение с помощью JS или TinyMCE

Сообщение Гость »


Мне нужно создать выборку с помощью собственных методов JS или TinyMCE.
В настоящее время у меня есть этот код, который делает то, что показано на изображении ниже:

Код: Выделить всё

const table = editor.dom.getParent(editor.selection.getNode(), 'table');
if (table) {
editor.selection.select(table);
}
I have also tried to do this and it turns out the same as above:

Код: Выделить всё

const table = editor.dom.getParent(editor.selection.getNode(), 'table');
if (table) {
const rng = editor.dom.createRng();
rng.selectNode(table);
editor.selection.setRng(rng);
}
Result image I get
I need to make this type of selection (this selection is with the mouse):
Expected result image


Источник: https://stackoverflow.com/questions/781 ... or-tinymce

Вернуться в «CSS»