Fixed restoring DOM selection and another bug in `moveNodes`

This commit is contained in:
jos 2018-08-09 18:13:49 +02:00
parent d81e2b8dab
commit 672b6491cd
2 changed files with 6 additions and 4 deletions

View File

@ -2044,7 +2044,7 @@ Node.onDragEnd = function (nodes, event) {
? (newIndex + nodes.length)
: newIndex;
if (!sameParent || oldIndex !== newIndex) {
if (!sameParent || oldIndexRedo !== newIndex) {
// only register this action if the node is actually moved to another place
editor._onAction('moveNodes', {
count: nodes.length,

View File

@ -730,9 +730,11 @@ treemode.getDomSelection = function () {
path: node ? node.getInternalPath() : null,
domName: domName,
range: range,
paths: this.multiselection.nodes.map(function (node) {
paths: this.multiselection.length > 0
? this.multiselection.nodes.map(function (node) {
return node.getInternalPath();
}),
})
: null,
scrollTop: this.scrollableContent ? this.scrollableContent.scrollTop : 0
};
};