Bug 513654 Closing an unselected content tab can lead to blank display. r=asuth
authorMark Banner <bugzilla@standard8.plus.com>
Tue, 01 Sep 2009 09:13:48 +0100
changeset 3464 096f7696808ef63d0feb4ed28e3f8f8732e53a57
parent 3463 db3f0d4e9082602b76c0392ce1ab6e225c0b237c
child 3465 4b46299abdf07d778d0f95ecd88e3ef62891657e
push idunknown
push userunknown
push dateunknown
reviewersasuth
bugs513654
Bug 513654 Closing an unselected content tab can lead to blank display. r=asuth
mail/base/content/tabmail.xml
--- a/mail/base/content/tabmail.xml
+++ b/mail/base/content/tabmail.xml
@@ -599,20 +599,25 @@
             this.tabInfo.splice(iTab, 1);
             tab.mode.tabs.splice(tab.mode.tabs.indexOf(tab), 1);
             this.tabContainer.removeChild(tabNode);
             if (this.tabContainer.selectedIndex == -1)
               this.tabContainer.selectedIndex =
                 (iTab == this.tabContainer.childNodes.length) ? iTab - 1 : iTab;
             if (this.currentTabInfo == tab)
               this.updateCurrentTab();
-              
+
             if (tab.panel) {
               this.panelContainer.removeChild(tab.panel);
               delete tab.panel;
+
+              // Ensure current tab is still selecte and displayed in the
+              // panelContainer.
+              this.panelContainer.selectedPanel =
+                this.currentTabInfo.panel || this.currentTabInfo.mode.tabType.panel;
             }
             if (this.tabContainer.childNodes.length == 1 &&
                 this.tabContainer.mAutoHide)
               this.tabContainer.collapsed = true;
           ]]>
         </body>
       </method>
       <method name="closeTabs">