mirror of
https://github.com/codex-team/editor.js
synced 2024-06-11 02:12:31 +02:00
several contenteditables instead of one. Saving caret position
This commit is contained in:
parent
6d3cd4ebfd
commit
9444cbd80a
|
@ -214,6 +214,7 @@ cEditor.ui = {
|
|||
cEditor.callback.redactorClicked(event);
|
||||
|
||||
cEditor.content.saveCaretPosition();
|
||||
// console.log(cEditor.content.caretOffset, cEditor.content.focusedNodeIndex);
|
||||
|
||||
}, false );
|
||||
|
||||
|
@ -417,6 +418,8 @@ cEditor.content = {
|
|||
var childs = NodeElement.childNodes,
|
||||
nodeChild = childs[nodeIndex];
|
||||
|
||||
console.log(caretOffset, nodeChild);
|
||||
|
||||
var range = document.createRange(),
|
||||
selection = window.getSelection();
|
||||
|
||||
|
@ -483,7 +486,8 @@ cEditor.content = {
|
|||
*/
|
||||
var nodeCreated = cEditor.draw.block(newBlockTagname, targetBlock.innerHTML);
|
||||
|
||||
/** Mark node as redactor block*/
|
||||
/** Mark node as redactor block */
|
||||
nodeCreated.contentEditable = "true";
|
||||
nodeCreated.classList.add('ce_block');
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue