Fixed restoring DOM selection and another bug in `moveNodes`
This commit is contained in:
parent
d81e2b8dab
commit
672b6491cd
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue