Fix undo/redo buttons in mode `code` not always updating

This commit is contained in:
jos 2020-02-05 11:46:23 +01:00
parent 98fb5114b7
commit 9fd1c0f932
2 changed files with 12 additions and 4 deletions

View File

@ -3,6 +3,11 @@
https://github.com/josdejong/jsoneditor
## 2020-02-05, version 8.5.2
- Fix undo/redo buttons in mode `code` not always updating.
## 2020-02-05, version 8.5.1
- Fix broken build.

View File

@ -669,7 +669,7 @@ textmode.destroy = function () {
textmode.compact = function () {
const json = this.get()
const text = JSON.stringify(json)
this._setText(text, false)
this.updateText(text)
}
/**
@ -678,7 +678,7 @@ textmode.compact = function () {
textmode.format = function () {
const json = this.get()
const text = JSON.stringify(json, null, this.indentation)
this._setText(text, false)
this.updateText(text)
}
/**
@ -687,7 +687,7 @@ textmode.format = function () {
textmode.repair = function () {
const text = this.getText()
const repairedText = repair(text)
this._setText(repairedText, false)
this.updateText(repairedText)
}
/**
@ -779,9 +779,12 @@ textmode._setText = function (jsonText, clearHistory) {
if (me.aceEditor) {
me.aceEditor.session.getUndoManager().reset()
}
}, 0)
})
}
setTimeout(() => this._updateHistoryButtons())
}
// validate JSON schema
this._debouncedValidate()
}