Paste hotfix

This commit is contained in:
George Berezhnoy 2017-04-24 20:34:40 +03:00
parent 02ab4b50d2
commit 4989affd05
3 changed files with 15 additions and 13 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -197,19 +197,10 @@ module.exports = function (paste) {
*/
var insertPastedParagraphs = function (paragraphs) {
var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin;
var NEW_BLOCK_TYPE = editor.settings.initialBlockPlugin,
currentNode = editor.content.currentNode;
/**
* If there was no data in working node, remove it
*/
if (editor.core.isBlockEmpty(editor.content.currentNode)) {
editor.content.currentNode.remove();
editor.caret.setToPreviousBlock(editor.caret.inputIndex);
}
paragraphs.forEach(function (paragraph) {
/** Don't allow empty paragraphs */
@ -233,6 +224,17 @@ module.exports = function (paste) {
editor.caret.setToPreviousBlock(editor.caret.getCurrentInputIndex() + 1);
/**
* If there was no data in working node, remove it
*/
if (editor.core.isBlockEmpty(currentNode)) {
currentNode.remove();
editor.ui.saveInputs();
}
};
/**