Fix undo/redo buttons in mode `code` not always updating
This commit is contained in:
parent
98fb5114b7
commit
9fd1c0f932
|
@ -3,6 +3,11 @@
|
||||||
https://github.com/josdejong/jsoneditor
|
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
|
## 2020-02-05, version 8.5.1
|
||||||
|
|
||||||
- Fix broken build.
|
- Fix broken build.
|
||||||
|
|
|
@ -669,7 +669,7 @@ textmode.destroy = function () {
|
||||||
textmode.compact = function () {
|
textmode.compact = function () {
|
||||||
const json = this.get()
|
const json = this.get()
|
||||||
const text = JSON.stringify(json)
|
const text = JSON.stringify(json)
|
||||||
this._setText(text, false)
|
this.updateText(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -678,7 +678,7 @@ textmode.compact = function () {
|
||||||
textmode.format = function () {
|
textmode.format = function () {
|
||||||
const json = this.get()
|
const json = this.get()
|
||||||
const text = JSON.stringify(json, null, this.indentation)
|
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 () {
|
textmode.repair = function () {
|
||||||
const text = this.getText()
|
const text = this.getText()
|
||||||
const repairedText = repair(text)
|
const repairedText = repair(text)
|
||||||
this._setText(repairedText, false)
|
this.updateText(repairedText)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -779,9 +779,12 @@ textmode._setText = function (jsonText, clearHistory) {
|
||||||
if (me.aceEditor) {
|
if (me.aceEditor) {
|
||||||
me.aceEditor.session.getUndoManager().reset()
|
me.aceEditor.session.getUndoManager().reset()
|
||||||
}
|
}
|
||||||
}, 0)
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTimeout(() => this._updateHistoryButtons())
|
||||||
}
|
}
|
||||||
|
|
||||||
// validate JSON schema
|
// validate JSON schema
|
||||||
this._debouncedValidate()
|
this._debouncedValidate()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue