fix for bug #342105: Close button not shown if there is only one tab per beltzner: "The close button should be shown, with the effect being that it disposes the tab and immediately opens a new one. Strange behaviour surely, but I think it's the easiest and most reliably understandable case." thanks to Simon <zeniko@gmail.com> for the patch. r=sspitzer, sr=mconnor

This commit is contained in:
sspitzer@mozilla.org 2007-08-21 22:01:39 -07:00
Родитель b878e1d20e
Коммит 30783feb10
1 изменённых файлов: 9 добавлений и 16 удалений

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

@ -2583,27 +2583,20 @@
// 3 - closeatend = close button at the end of the tabstrip
switch (this.mCloseButtons) {
case 0:
if (this.childNodes.length == 1)
this.setAttribute("closebuttons", "noclose");
else
this.setAttribute("closebuttons", "activetab");
this.setAttribute("closebuttons", "activetab");
break;
case 1:
try {
// if we have only one tab, hide the closebutton
if (this.childNodes.length == 1)
this.setAttribute("closebuttons", "noclose");
else {
var width = this.firstChild.boxObject.width;
// 0 width is an invalid value and indicates
// an item without display, so ignore.
if (width > this.mTabClipWidth || width == 0)
this.setAttribute("closebuttons", "alltabs");
else
this.setAttribute("closebuttons", "activetab");
}
var width = this.firstChild.boxObject.width;
// 0 width is an invalid value and indicates
// an item without display, so ignore.
if (width > this.mTabClipWidth || width == 0)
this.setAttribute("closebuttons", "alltabs");
else
this.setAttribute("closebuttons", "activetab");
}
catch (e) {
// XXXzeniko what error are we catching here?
}
break;
case 2: