mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 877467 - Use a flat list when showing prompts. r=mfinkle
This commit is contained in:
parent
4b1dd6e019
commit
66654705cf
@ -112,17 +112,13 @@ Prompt.prototype = {
|
||||
this.callback(data);
|
||||
},
|
||||
|
||||
_setListItems: function(aItems, aInGroup) {
|
||||
_setListItems: function(aItems) {
|
||||
let hasSelected = false;
|
||||
if (!aInGroup)
|
||||
this.msg.listitems = [];
|
||||
this.msg.listitems = [];
|
||||
|
||||
aItems.forEach(function(item) {
|
||||
let obj = { id: item.id };
|
||||
|
||||
if (aInGroup !== undefined)
|
||||
obj.inGroup = aInGroup;
|
||||
|
||||
obj.label = item.label;
|
||||
|
||||
if (item.disabled)
|
||||
@ -136,19 +132,17 @@ Prompt.prototype = {
|
||||
this.msg.selected[this.msg.listitems.length] = item.selected;
|
||||
}
|
||||
|
||||
if (item.children) {
|
||||
if (item.header)
|
||||
obj.isGroup = true;
|
||||
} else if (item.submenu) {
|
||||
|
||||
if (item.menu)
|
||||
obj.isParent = true;
|
||||
}
|
||||
|
||||
// Order matters in the java message, so make sure we add the obj
|
||||
// to the list before we add its children
|
||||
if (item.child)
|
||||
obj.inGroup = true;
|
||||
|
||||
this.msg.listitems.push(obj);
|
||||
|
||||
if (item.children)
|
||||
this._setListItems(item.children, true);
|
||||
|
||||
}, this);
|
||||
return this;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user