Skip to content

Commit

Permalink
Fix history (undo/redo) being cleared in mode code and text after…
Browse files Browse the repository at this point in the history
… transforming or sorting
  • Loading branch information
josdejong committed Feb 5, 2020
1 parent 9e9fd72 commit 42672ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/js/textmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand All @@ -438,7 +438,7 @@ textmode._showTransformModal = function () {
executeQuery,
onTransform: query => {
const updatedJson = executeQuery(json, query)
this.set(updatedJson)
this.update(updatedJson)
}
})
}
Expand Down

0 comments on commit 42672ee

Please sign in to comment.