Fix #908: editor throwing an exception when switching from `'preview'` to `'code'` mode

This commit is contained in:
jos 2020-02-17 20:08:16 +01:00
parent 582645df70
commit 3ad5c9f9c1
3 changed files with 11 additions and 3 deletions

View File

@ -3,6 +3,12 @@
https://github.com/josdejong/jsoneditor https://github.com/josdejong/jsoneditor
## not yet published, version 8.6.1
- Fix #908: editor throwing an exception when switching from `'preview'`
to `'code'` mode.
## 2020-02-16, version 8.6.0 ## 2020-02-16, version 8.6.0
- Fixed #906: Implemented turning Python objects containing `True`, `False` - Fixed #906: Implemented turning Python objects containing `True`, `False`

View File

@ -230,7 +230,7 @@ Constructs a new JSONEditor.
- `{boolean} history` - `{boolean} history`
Enables history, adds a button Undo and Redo to the menu of the JSONEditor. `true` by default. Only applicable when `mode` is 'tree' or 'form'. Enables history, adds a button Undo and Redo to the menu of the JSONEditor. `true` by default. Only applicable when `mode` is `'tree'`, `'form'`, or `'preview'`.
- `{String} mode` - `{String} mode`

View File

@ -424,8 +424,10 @@ previewmode.destroy = function () {
this._debouncedValidate = null this._debouncedValidate = null
this.history.clear() if (this.history) {
this.history = null this.history.clear()
this.history = null
}
// Removing the FocusTracker set to track the editor's focus event // Removing the FocusTracker set to track the editor's focus event
this.frameFocusTracker.destroy() this.frameFocusTracker.destroy()