luci-base: widgets.js: CBIZoneSelect: fix availability of "device" choice
Ref: https://github.com/openwrt/luci/issues/2889 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
0be4ad51a0
commit
d1841af2f0
1 changed files with 10 additions and 6 deletions
|
@ -150,11 +150,14 @@ var CBIZoneSelect = form.ListValue.extend({
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var anyval = node.querySelector('[data-value="*"]'),
|
var anyval = node.querySelector('[data-value="*"]'),
|
||||||
emptyval = node.querySelector('[data-value=""]') || anyval.cloneNode(true);
|
emptyval = node.querySelector('[data-value=""]');
|
||||||
|
|
||||||
emptyval.removeAttribute('display');
|
if (emptyval == null) {
|
||||||
emptyval.removeAttribute('selected');
|
emptyval = anyval.cloneNode(true);
|
||||||
emptyval.setAttribute('data-value', '');
|
emptyval.removeAttribute('display');
|
||||||
|
emptyval.removeAttribute('selected');
|
||||||
|
emptyval.setAttribute('data-value', '');
|
||||||
|
}
|
||||||
|
|
||||||
L.dom.content(emptyval.querySelector('span'), [
|
L.dom.content(emptyval.querySelector('span'), [
|
||||||
E('strong', _('Device')), ' (%s)'.format(_('input'))
|
E('strong', _('Device')), ' (%s)'.format(_('input'))
|
||||||
|
@ -171,8 +174,9 @@ var CBIZoneSelect = form.ListValue.extend({
|
||||||
}
|
}
|
||||||
else if (this.option == 'dest') {
|
else if (this.option == 'dest') {
|
||||||
for (var i = 0; i < this.section.children.length; i++) {
|
for (var i = 0; i < this.section.children.length; i++) {
|
||||||
if (this.section.children[i].option == 'src') {
|
var opt = this.section.children[i];
|
||||||
if (!this.section.children[i].cfgvalue(section_id)) {
|
if (opt.option == 'src') {
|
||||||
|
if (!opt.cfgvalue(section_id) && !opt.default) {
|
||||||
var emptyval = elem.querySelector('[data-value=""]');
|
var emptyval = elem.querySelector('[data-value=""]');
|
||||||
|
|
||||||
if (emptyval != null)
|
if (emptyval != null)
|
||||||
|
|
Loading…
Reference in a new issue