From 62691b659d28709edd066e19801f670ddce1b37e Mon Sep 17 00:00:00 2001 From: "suresh%netscape.com" Date: Tue, 23 Apr 2002 01:06:34 +0000 Subject: [PATCH] fix for 138231. Select a tab if the last selected one is not ``in view''. r=suresh, sr=alecf --- .../sidebar/resources/sidebarOverlay.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xpfe/components/sidebar/resources/sidebarOverlay.js b/xpfe/components/sidebar/resources/sidebarOverlay.js index e950855935b6..ce8a8f8271e7 100644 --- a/xpfe/components/sidebar/resources/sidebarOverlay.js +++ b/xpfe/components/sidebar/resources/sidebarOverlay.js @@ -300,7 +300,8 @@ function (force_reload) sidebarObj.collapsed = false; } - if (sidebarObj.panels.num_panels_included() > gNumTabsInViewPref) + var num_included = sidebarObj.panels.num_panels_included(); + if (num_included > gNumTabsInViewPref) document.getElementById("nav-buttons-box").hidden = false; else document.getElementById("nav-buttons-box").hidden = true; @@ -363,6 +364,18 @@ function (force_reload) header.removeAttribute('hidden'); header.setAttribute("in-view", true); num_in_view++; + + // (a) when we have hit the maximum number of tabs that can be in view and no tab + // has been selected yet + // -or- + // (b) when we have reached the last tab we are about to display + if ( ((num_in_view == num_included) || + (num_in_view == gNumTabsInViewPref)) && + !is_after_selected ) + { + selected_id = id; + this.node.setAttribute('last-selected-panel', id); + } // Pick sandboxed, or unsandboxed iframe var iframe = panel.get_iframe();