Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/luci-base/htdocs/luci-static/resources/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -4451,7 +4451,7 @@ const CBIValue = CBIAbstractValue.extend(/** @lends LuCI.form.Value.prototype */
'for': 'widget.cbid.%s.%s.%s'.format(config_name, section_id, this.option),
'click': (ev) => {
const node = ev.currentTarget;
const elem = node.nextElementSibling.querySelector(`#${node.getAttribute('for')}`) ?? node.nextElementSibling.querySelector(`[data-widget-id="${node.getAttribute('for')}"]`);
const elem = node.nextElementSibling.querySelector(`[data-widget-id="${node.getAttribute('for')}"]`) ?? node.nextElementSibling.querySelector(`#${node.getAttribute('for')}`);

if (elem) {
elem.click();
Expand Down
9 changes: 9 additions & 0 deletions modules/luci-base/htdocs/luci-static/resources/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1090,9 +1090,18 @@
'multiple': this.options.multiple ? '' : null,
'optional': this.options.optional ? '' : null,
'disabled': this.options.disabled ? '' : null,
'data-widget-id': this.options.id ? `widget.${this.options.id}` : null,
'tabindex': -1
}, E('ul'));

if (this.options.id)
sb.appendChild(E('select', {
'id': `widget.${this.options.id}`,
'style': 'display:none',
'aria-hidden': 'true',
'tabindex': -1
}));

let keys = Object.keys(this.choices);

if (this.options.sort === true)
Expand Down Expand Up @@ -5701,7 +5710,7 @@
const className = 'view.%s'.format(path.replace(/\//g, '.'));

return L.require(className).then(view => {
if (!(view instanceof View))

Check warning on line 5713 in modules/luci-base/htdocs/luci-static/resources/ui.js

View workflow job for this annotation

GitHub Actions / eslint

'View' is not defined
throw new TypeError('Loaded class %s is not a descendant of View'.format(className));

return view;
Expand Down
Loading