Fixed undo move losing position

This commit is contained in:
jos 2016-09-23 09:33:27 +02:00
parent 7f979b97dd
commit 515e7a6bf2
1 changed files with 12 additions and 2 deletions

View File

@ -428,7 +428,10 @@ export function move (data, path, from, options) {
op: 'add', op: 'add',
path, path,
value: result2.revert[0].value, value: result2.revert[0].value,
jsoneditor: result2.revert[0].jsoneditor jsoneditor: {
before: options.before,
type: result2.revert[0].jsoneditor.type
}
} }
] ]
} }
@ -437,7 +440,14 @@ export function move (data, path, from, options) {
return { return {
data: result2.data, data: result2.data,
revert: [ revert: [
{op: 'move', from: path, path: from} {
op: 'move',
from: path,
path: from,
jsoneditor: {
before: options.before
}
}
] ]
} }
} }