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>
This commit is contained in:
parent
6125c9178e
commit
ee9b3a4e94
1 changed files with 2 additions and 2 deletions
|
@ -3351,10 +3351,10 @@ var CBIValue = CBIAbstractValue.extend(/** @lends LuCI.form.Value.prototype */ {
|
||||||
optionEl.classList.add('hidden');
|
optionEl.classList.add('hidden');
|
||||||
|
|
||||||
optionEl.addEventListener('widget-change',
|
optionEl.addEventListener('widget-change',
|
||||||
L.bind(this.handleValueChange, this, section_id, {}));
|
L.bind(this.map.checkDepends, this.map));
|
||||||
|
|
||||||
optionEl.addEventListener('widget-change',
|
optionEl.addEventListener('widget-change',
|
||||||
L.bind(this.map.checkDepends, this.map));
|
L.bind(this.handleValueChange, this, section_id, {}));
|
||||||
|
|
||||||
dom.bindClassInstance(optionEl, this);
|
dom.bindClassInstance(optionEl, this);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue