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> (cherry picked from commite3ef463ccd
)
This commit is contained in:
parent
9be5a3df0b
commit
243c6c525d
1 changed files with 3 additions and 3 deletions
|
@ -773,7 +773,7 @@ var UISelect = UIElement.extend(/** @lends LuCI.ui.Select.prototype */ {
|
||||||
bind: function(frameEl) {
|
bind: function(frameEl) {
|
||||||
this.node = 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.setUpdateEvents(frameEl.firstChild, 'change', 'click', 'blur');
|
||||||
this.setChangeEvents(frameEl.firstChild, 'change');
|
this.setChangeEvents(frameEl.firstChild, 'change');
|
||||||
}
|
}
|
||||||
|
@ -792,7 +792,7 @@ var UISelect = UIElement.extend(/** @lends LuCI.ui.Select.prototype */ {
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
getValue: function() {
|
getValue: function() {
|
||||||
if (this.options.widget == 'select')
|
if (this.options.widget != 'radio' && this.options.widget != 'checkbox')
|
||||||
return this.node.firstChild.value;
|
return this.node.firstChild.value;
|
||||||
|
|
||||||
var radioEls = this.node.querySelectorAll('input[type="radio"]');
|
var radioEls = this.node.querySelectorAll('input[type="radio"]');
|
||||||
|
@ -805,7 +805,7 @@ var UISelect = UIElement.extend(/** @lends LuCI.ui.Select.prototype */ {
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
setValue: function(value) {
|
setValue: function(value) {
|
||||||
if (this.options.widget == 'select') {
|
if (this.options.widget != 'radio' && this.options.widget != 'checkbox') {
|
||||||
if (value == null)
|
if (value == null)
|
||||||
value = '';
|
value = '';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue