diff options
author | Oldřich Jedlička <oldium.pro@gmail.com> | 2020-10-20 20:15:30 +0200 |
---|---|---|
committer | Oldřich Jedlička <oldium.pro@gmail.com> | 2020-10-30 21:18:45 +0100 |
commit | ee9b3a4e9482222da41dfb884e6185d6180147f1 (patch) | |
tree | 805039fce2d0628dab906afe71a1408c1cbdaa6c /modules | |
parent | 6125c9178eca7ecf30bb7bfc5c472d533e55606f (diff) |
luci-base: Fix using isActive in widget-change notification.
The `onchange` notification handler is called too early to be able to
evaluate other widget's `isActive()` status. Solve this by changing order
of event handling - first register/execute `map.checkDepends` and then
`onchange`.
Fixes: openwrt/luci#4516.
Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/form.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/form.js b/modules/luci-base/htdocs/luci-static/resources/form.js index 568a4abb6..1d705e3bf 100644 --- a/modules/luci-base/htdocs/luci-static/resources/form.js +++ b/modules/luci-base/htdocs/luci-static/resources/form.js @@ -3351,10 +3351,10 @@ var CBIValue = CBIAbstractValue.extend(/** @lends LuCI.form.Value.prototype */ { optionEl.classList.add('hidden'); optionEl.addEventListener('widget-change', - L.bind(this.handleValueChange, this, section_id, {})); + L.bind(this.map.checkDepends, this.map)); optionEl.addEventListener('widget-change', - L.bind(this.map.checkDepends, this.map)); + L.bind(this.handleValueChange, this, section_id, {})); dom.bindClassInstance(optionEl, this); |