Fix history (undo/redo) being cleared in mode `code` and `text` after transforming or sorting

This commit is contained in:
jos 2020-02-05 10:11:37 +01:00
parent 9e9fd72edd
commit 42672eeef5
2 changed files with 5 additions and 3 deletions

View File

@ -9,6 +9,8 @@ https://github.com/josdejong/jsoneditor
Transform modal. New options `createQuery`, `executeQuery`, and
`queryDescription` are available for this now. An example is available
in `examples/23_custom_query_language.html`. See #857, #871.
- Fix history (undo/redo) being cleared in mode `code` and `text` after
transforming or sorting.
## 2020-01-25, version 8.4.1

View File

@ -408,14 +408,14 @@ textmode._showSortModal = function () {
const sortedJson = sort(json, sortedBy.path, sortedBy.direction)
me.sortedBy = sortedBy
me.set(sortedJson)
me.update(sortedJson)
}
if (isObject(json)) {
const sortedJson = sortObjectKeys(json, sortedBy.direction)
me.sortedBy = sortedBy
me.set(sortedJson)
me.update(sortedJson)
}
}
@ -438,7 +438,7 @@ textmode._showTransformModal = function () {
executeQuery,
onTransform: query => {
const updatedJson = executeQuery(json, query)
this.set(updatedJson)
this.update(updatedJson)
}
})
}