Bug 590481 - Menulist are not scrollable [r=mfinkle]
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -2089,19 +2089,19 @@ var MenuListHelperUI = {
let listbox = this._popup.firstChild;
while (listbox.firstChild)
listbox.removeChild(listbox.firstChild);
let children = this._currentList.menupopup.children;
for (let i = 0; i < children.length; i++) {
let child = children[i];
let item = document.createElement("richlistitem");
- if (child.selected)
- item.setAttribute("selected", child.selected);
- item.setAttribute("class", "menulist-command");
+ // Add selected as a class name instead of an attribute to not being overidden
+ // by the richlistbox behavior (it sets the "current" and "selected" attribute
+ item.setAttribute("class", "menulist-command" + (child.selected ? " selected" : ""));
let label = document.createElement("label");
label.setAttribute("value", child.label);
item.appendChild(label);
listbox.appendChild(item);
}
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -535,18 +535,18 @@
<hbox id="select-buttons" pack="center">
<button id="select-buttons-done" class="button-dark" label="&selectHelper.done;" oncommand="SelectHelperUI.hide();"/>
</hbox>
</vbox>
<spacer flex="1000"/>
</vbox>
<hbox id="menulist-container" class="window-width window-height context-block" top="0" left="0" hidden="true" flex="1">
- <vbox id="menulist-popup" class="dialog-dark">
- <richlistbox id="menulist-commands" onselect="MenuListHelperUI.selectByIndex(this.selectedIndex)"/>
+ <vbox id="menulist-popup" class="dialog-dark">
+ <richlistbox id="menulist-commands" onclick="if (event.target != this) MenuListHelperUI.selectByIndex(this.selectedIndex);" flex="1"/>
</vbox>
</hbox>
<hbox id="context-container" class="window-width window-height context-block" top="0" left="0" hidden="true">
<vbox id="context-popup" class="dialog-dark">
<hbox id="context-header">
<label id="context-hint" crop="center" flex="1"/>
</hbox>
--- a/mobile/themes/core/browser.css
+++ b/mobile/themes/core/browser.css
@@ -1538,19 +1538,19 @@ pageaction:hover:active > vbox > .pageac
.menulist-command:first-child:last-child {
-moz-border-radius: 8px;
}
.menulist-command:hover:active {
background: #8db8d8;
}
-.menulist-command[selected="true"] {
+.menulist-command.selected {
+ background: #8db8d8;
pointer-events: none;
- background: #8db8d8;
}
/* context popup ----------------------------------------------------------- */
#context-popup {
/* Remove some dialog-dark styles */
padding: 8px 0 0 0;
border: none;
}