зеркало из https://github.com/mozilla/pjs.git
Bug 341047 - After 'Close other tabs' tab's context menu contains scrollbars, r=mano
This commit is contained in:
Родитель
423c9a6a94
Коммит
2ca57ae6d6
|
@ -166,11 +166,17 @@
|
|||
|
||||
this._scrollButtonUp.collapsed = true;
|
||||
this._scrollButtonDown.collapsed = true;
|
||||
var childNodes = document.getAnonymousNodes(this._scrollbox);
|
||||
if (childNodes && childNodes.length) {
|
||||
this.ensureElementIsVisible(childNodes[0]);
|
||||
if (childNodes.length > 1)
|
||||
this.ensureElementIsVisible(childNodes[childNodes.length-1]);
|
||||
try {
|
||||
// See bug 341047 and comments in overflow handler as to why
|
||||
// try..catch is needed here
|
||||
var childNodes = document.getAnonymousNodes(this._scrollbox);
|
||||
if (childNodes && childNodes.length) {
|
||||
if (childNodes.length > 0)
|
||||
this.ensureElementIsVisible(childNodes[0]);
|
||||
}
|
||||
catch(e) {
|
||||
this._scrollButtonUp.collapsed = false;
|
||||
this._scrollButtonDown.collapsed = false;
|
||||
}
|
||||
]]></handler>
|
||||
|
||||
|
@ -181,7 +187,19 @@
|
|||
|
||||
this._scrollButtonUp.collapsed = false;
|
||||
this._scrollButtonDown.collapsed = false;
|
||||
this._updateScrollButtonsDisabledState();
|
||||
try {
|
||||
// See bug 341047, the overflow event is dispatched when the
|
||||
// scrollbox already is mostly destroyed. This causes some code in
|
||||
// _updateScrollButtonsDisabledState() to throw an error. It also
|
||||
// means that the scrollbarbuttons were uncollapsed when that should
|
||||
// not be happening, because the whole overflow event should not be
|
||||
// happening in that case.
|
||||
this._updateScrollButtonsDisabledState();
|
||||
}
|
||||
catch(e) {
|
||||
this._scrollButtonUp.collapsed = true;
|
||||
this._scrollButtonDown.collapsed = true;
|
||||
}
|
||||
]]></handler>
|
||||
|
||||
<handler event="scroll" action="this._updateScrollButtonsDisabledState()"/>
|
||||
|
|
Загрузка…
Ссылка в новой задаче