luci-base: ui.js: fix input value reading for select widgets
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>
This commit is contained in:
parent
97bd192c7e
commit
e3ef463ccd
1 changed files with 3 additions and 3 deletions
|
@ -770,7 +770,7 @@ var UISelect = UIElement.extend(/** @lends LuCI.ui.Select.prototype */ {
|
|||
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');
|
||||
}
|
||||
|
@ -789,7 +789,7 @@ var UISelect = UIElement.extend(/** @lends LuCI.ui.Select.prototype */ {
|
|||
|
||||
/** @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"]');
|
||||
|
@ -802,7 +802,7 @@ var UISelect = UIElement.extend(/** @lends LuCI.ui.Select.prototype */ {
|
|||
|
||||
/** @override */
|
||||
setValue: function(value) {
|
||||
if (this.options.widget == 'select') {
|
||||
if (this.options.widget != 'radio' && this.options.widget != 'checkbox') {
|
||||
if (value == null)
|
||||
value = '';
|
||||
|
||||
|
|
Loading…
Reference in a new issue