Force saveTree output
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2020-11-02 22:51:19 +01:00
parent 8384c115c6
commit 0012bb2acc

View File

@ -63,9 +63,10 @@ function editor(root, inputData, options) {
}); });
} }
function saveTree(from) { function saveTree(from, opt) {
opt = _.merge({force: false}, opt)
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
if (store.hasChanged()) { if (opt.force || store.hasChanged()) {
resolve(store.tree(from)) resolve(store.tree(from))
store.clearChanged() store.clearChanged()
} }
@ -83,7 +84,7 @@ function editor(root, inputData, options) {
let id = item.attr('data-id') let id = item.attr('data-id')
if (opt.recursive) { if (opt.recursive) {
return saveTree(id) return saveTree(id, {force: true})
} }
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {