Fixed clicking format/compact not triggering an onChange event
This commit is contained in:
parent
8ec471b6dc
commit
f4492de1ca
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue