mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 19:55:39 +00:00
Bug 877467 - Use a flat list when showing prompts. r=mfinkle
This commit is contained in:
parent
4795726e4a
commit
487f97b0ef
@ -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