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 git-svn-id: svn://10.0.0.236/trunk@232753 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
a79c56d295
commit
7f2a788fb9
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user