mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 860055 - SideMenuWidget shouldn't scroll back to the selected item when new requests are coming in, r=dcamp
This commit is contained in:
parent
3ce07a9bc8
commit
8790fa745f
@ -260,6 +260,7 @@ create({ constructor: RequestsMenuView, proto: MenuContainer.prototype }, {
|
||||
dumpn("Initializing the RequestsMenuView");
|
||||
|
||||
this.node = new SideMenuWidget($("#requests-menu-contents"), false);
|
||||
this.node.maintainSelectionVisible = false;
|
||||
|
||||
this.node.addEventListener("mousedown", this._onMouseDown, false);
|
||||
this.node.addEventListener("select", this._onSelect, false);
|
||||
|
@ -63,6 +63,12 @@ SideMenuWidget.prototype = {
|
||||
get document() this._parent.ownerDocument,
|
||||
get window() this.document.defaultView,
|
||||
|
||||
/**
|
||||
* Specifies if this container should try to keep the selected item visible.
|
||||
* (For example, when new items are added the selection is brought into view).
|
||||
*/
|
||||
maintainSelectionVisible: true,
|
||||
|
||||
/**
|
||||
* Specifies if groups in this container should be sorted alphabetically.
|
||||
*/
|
||||
@ -84,7 +90,9 @@ SideMenuWidget.prototype = {
|
||||
* The element associated with the displayed item.
|
||||
*/
|
||||
insertItemAt: function SMW_insertItemAt(aIndex, aContents, aTooltip = "", aGroup = "") {
|
||||
if (this.maintainSelectionVisible) {
|
||||
this.ensureSelectionIsVisible(true, true); // Don't worry, it's delayed.
|
||||
}
|
||||
|
||||
let group = this._getGroupForName(aGroup);
|
||||
return group.insertItemAt(aIndex, aContents, aTooltip, this._showArrows);
|
||||
|
Loading…
Reference in New Issue
Block a user