Fixed clicking format/compact not triggering an onChange event

This commit is contained in:
jos 2016-01-17 15:24:46 +01:00
parent 8ec471b6dc
commit f4492de1ca
2 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,7 @@ https://github.com/josdejong/jsoneditor
## not yet released, version 5.1.2
- Improvements in sanitizing invalid JSON.
- Fixed clicking format/compact not triggering an onChange event.
## 2016-01-16, version 5.1.1

View File

@ -99,6 +99,7 @@ textmode.create = function (container, options) {
buttonFormat.onclick = function () {
try {
me.format();
me._onChange();
}
catch (err) {
me._onError(err);
@ -113,6 +114,7 @@ textmode.create = function (container, options) {
buttonCompact.onclick = function () {
try {
me.compact();
me._onChange();
}
catch (err) {
me._onError(err);
@ -235,9 +237,11 @@ textmode._onKeyDown = function (event) {
if (keynum == 220 && event.ctrlKey) {
if (event.shiftKey) { // Ctrl+Shift+\
this.compact();
this._onChange();
}
else { // Ctrl+\
this.format();
this._onChange();
}
handled = true;
}