mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-04-06 10:46:57 +00:00
Merge f9cec3a7d219fae5084f8a2177fe3cb59f44516c into 961e74f73d230d0028efb586db07699120eac888
This commit is contained in:
commit
e5329de006
@ -122,8 +122,17 @@ SelectWidget.prototype.setSelectValue = function() {
|
||||
value = value === undefined ? "" : value;
|
||||
var select = this.getSelectDomNode();
|
||||
var values = Array.isArray(value) ? value : $tw.utils.parseStringArray(value);
|
||||
var child;
|
||||
for(var i=0; i < select.children.length; i++){
|
||||
select.children[i].selected = values.indexOf(select.children[i].value) !== -1
|
||||
child=select.children[i];
|
||||
if (child.children.length === 0){
|
||||
child.selected = values.indexOf(child.value) !== -1
|
||||
} else {
|
||||
// grouped options
|
||||
for(var y=0; y < child.children.length; y++){
|
||||
child.children[y].selected = values.indexOf(child.children[y].value) !== -1
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var domNode = this.getSelectDomNode();
|
||||
|
Loading…
x
Reference in New Issue
Block a user