luci-base: form.js: support passing a callback to Map.save()
The given callback function will be executed after the map is parsed, but before the uci is saved. This is useful to add further uci changes before the map is re-rendered. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
082fd9ff10
commit
3b335f2764
1 changed files with 2 additions and 1 deletions
|
@ -132,10 +132,11 @@ var CBIMap = CBINode.extend({
|
|||
return Promise.all(tasks);
|
||||
},
|
||||
|
||||
save: function() {
|
||||
save: function(cb) {
|
||||
this.checkDepends();
|
||||
|
||||
return this.parse()
|
||||
.then(cb)
|
||||
.then(uci.save.bind(uci))
|
||||
.then(this.load.bind(this))
|
||||
.then(this.renderContents.bind(this))
|
||||
|
|
Loading…
Reference in a new issue