mirror of
https://github.com/codex-team/editor.js
synced 2024-06-26 09:20:07 +02:00
debug
This commit is contained in:
parent
7f6d3ceb71
commit
f249570f54
|
@ -268,10 +268,10 @@ cEditor.callback = {
|
||||||
|
|
||||||
if (cEditor.toolbar.opened && event.target == cEditor.nodes.redactor) {
|
if (cEditor.toolbar.opened && event.target == cEditor.nodes.redactor) {
|
||||||
|
|
||||||
// event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
cEditor.toolbar.toolClicked(event);
|
cEditor.toolbar.toolClicked(event);
|
||||||
cEditor.toolbar.close();
|
// cEditor.toolbar.close();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -289,7 +289,7 @@ cEditor.callback = {
|
||||||
|
|
||||||
cEditor.content.workingNodeChanged();
|
cEditor.content.workingNodeChanged();
|
||||||
|
|
||||||
cEditor.toolbar.close();
|
// cEditor.toolbar.close();
|
||||||
cEditor.toolbar.move();
|
cEditor.toolbar.move();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -355,13 +355,26 @@ cEditor.content = {
|
||||||
focused;
|
focused;
|
||||||
|
|
||||||
if (selection.anchorNode != null) {
|
if (selection.anchorNode != null) {
|
||||||
focused = selection.anchorNode.tagName ? selection.anchorNode : selection.focusNode.parentElement;
|
|
||||||
|
if ( selection.anchorNode.nodeType == cEditor.core.nodeTypes.TAG ) {
|
||||||
|
focused = selection.anchorNode;
|
||||||
|
} else {
|
||||||
|
focused = selection.focusNode.parentElement;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !cEditor.parser.isFirstLevelBlock(focused) ) {
|
||||||
|
focused = focused.parentElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('focused' , focused);
|
||||||
|
|
||||||
if (focused != cEditor.nodes.redactor){
|
if (focused != cEditor.nodes.redactor){
|
||||||
return focused;
|
return focused;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -408,6 +421,9 @@ cEditor.content = {
|
||||||
* Set new node as current
|
* Set new node as current
|
||||||
*/
|
*/
|
||||||
cEditor.content.workingNodeChanged(nodeCreated);
|
cEditor.content.workingNodeChanged(nodeCreated);
|
||||||
|
setTimeout(function() {
|
||||||
|
cEditor.content.currentNode.focus();
|
||||||
|
}, 100);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -433,6 +449,9 @@ cEditor.content = {
|
||||||
* Set new node as current
|
* Set new node as current
|
||||||
*/
|
*/
|
||||||
cEditor.content.workingNodeChanged(nodeCreated);
|
cEditor.content.workingNodeChanged(nodeCreated);
|
||||||
|
setTimeout(function() {
|
||||||
|
cEditor.content.currentNode.focus();
|
||||||
|
}, 100);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue