Fixed #566: transform function broken, regression since `v5.20.0`
This commit is contained in:
parent
eb56fc38b4
commit
ffe727849e
|
@ -3,6 +3,11 @@
|
|||
https://github.com/josdejong/jsoneditor
|
||||
|
||||
|
||||
## 2018-08-17, version 5.23.1
|
||||
|
||||
- Fixed #566: transform function broken, regression since `v5.20.0`.
|
||||
|
||||
|
||||
## 2018-08-15, version 5.23.0
|
||||
|
||||
- Implemented support for custom validation using a new `onValidate` callback.
|
||||
|
|
|
@ -3621,15 +3621,18 @@ Node.prototype.transform = function (query) {
|
|||
|
||||
try {
|
||||
// apply the JMESPath query
|
||||
var oldValue = this.getInternalValue();
|
||||
var newValue = jmespath.search(oldValue, query);
|
||||
var oldInternalValue = this.getInternalValue();
|
||||
|
||||
var oldValue = this.getValue();
|
||||
var newValue = jmespath.search(oldValue, query);
|
||||
this.setValue(newValue);
|
||||
|
||||
var newInternalValue = this.getInternalValue();
|
||||
|
||||
this.editor._onAction('transform', {
|
||||
path: this.getInternalPath(),
|
||||
oldValue: oldValue,
|
||||
newValue: this.getInternalValue()
|
||||
oldValue: oldInternalValue,
|
||||
newValue: newInternalValue
|
||||
});
|
||||
|
||||
this.showChilds();
|
||||
|
|
Loading…
Reference in New Issue