Merge remote-tracking branch 'origin/master' into release.1.6

This commit is contained in:
George Berezhnoy 2017-04-24 20:44:12 +03:00
commit f2ef09ed43
4 changed files with 17 additions and 15 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();
}
};
/**

View file

@ -1,6 +1,6 @@
{
"name": "codex.editor",
"version": "1.6.4",
"version": "1.6.5",
"description": "Codex Editor. Native JS, based on API and Open Source",
"main": "index.js",
"scripts": {