luci-base: ui.js: resolve parent ul early in UIDropdown.toggleItem()
The parent node of the current li might be null after collapsing the
dropdown, so resolve the parent ul early to avoid passing null to
subsequent calls.
Fixes clearing custom input values in DynamicList dropdowns.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit b8d2bcd432
)
This commit is contained in:
parent
d55158730e
commit
af4c851d35
1 changed files with 3 additions and 1 deletions
|
@ -1360,6 +1360,8 @@ var UIDropdown = UIElement.extend(/** @lends LuCI.ui.Dropdown.prototype */ {
|
||||||
|
|
||||||
/** @private */
|
/** @private */
|
||||||
toggleItem: function(sb, li, force_state) {
|
toggleItem: function(sb, li, force_state) {
|
||||||
|
var ul = li.parentNode;
|
||||||
|
|
||||||
if (li.hasAttribute('unselectable'))
|
if (li.hasAttribute('unselectable'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1436,7 +1438,7 @@ var UIDropdown = UIElement.extend(/** @lends LuCI.ui.Dropdown.prototype */ {
|
||||||
this.closeDropdown(sb, true);
|
this.closeDropdown(sb, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.saveValues(sb, li.parentNode);
|
this.saveValues(sb, ul);
|
||||||
},
|
},
|
||||||
|
|
||||||
/** @private */
|
/** @private */
|
||||||
|
|
Loading…
Reference in a new issue