From: Jo-Philipp Wich Date: Mon, 12 Aug 2019 17:45:18 +0000 (+0200) Subject: luci-base: form.js: support passing a callback to Map.save() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3b335f2764bfda3f18e13bf492e461977599e411;p=project%2Fluci.git 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 --- diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index 9c5cb93650..44a2df22f1 100644 --- a/modules/luci-base/htdocs/luci-static/resources/form.js +++ b/modules/luci-base/htdocs/luci-static/resources/form.js @@ -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))