Fixes: #3989
Fixes: 81effc111 ("luci-base: ui.js: assume select widget by default for ListValue widget")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
bind: function(frameEl) {
this.node = frameEl;
bind: function(frameEl) {
this.node = frameEl;
- if (this.options.widget == 'select') {
+ if (this.options.widget != 'radio' && this.options.widget != 'checkbox') {
this.setUpdateEvents(frameEl.firstChild, 'change', 'click', 'blur');
this.setChangeEvents(frameEl.firstChild, 'change');
}
this.setUpdateEvents(frameEl.firstChild, 'change', 'click', 'blur');
this.setChangeEvents(frameEl.firstChild, 'change');
}
/** @override */
getValue: function() {
/** @override */
getValue: function() {
- if (this.options.widget == 'select')
+ if (this.options.widget != 'radio' && this.options.widget != 'checkbox')
return this.node.firstChild.value;
var radioEls = this.node.querySelectorAll('input[type="radio"]');
return this.node.firstChild.value;
var radioEls = this.node.querySelectorAll('input[type="radio"]');
/** @override */
setValue: function(value) {
/** @override */
setValue: function(value) {
- if (this.options.widget == 'select') {
+ if (this.options.widget != 'radio' && this.options.widget != 'checkbox') {
if (value == null)
value = '';
if (value == null)
value = '';