Bug 341047 - After 'Close other tabs' tab's context menu contains scrollbars, r=mano

This commit is contained in:
martijn.martijn%gmail.com 2006-08-21 14:17:51 +00:00
Родитель 60b4aba084
Коммит f20b1bc90d
1 изменённых файлов: 24 добавлений и 6 удалений

Просмотреть файл

@ -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()"/>