From e5ffbf3bea07f90d3e4e08b1eb58c6807cc1bdfc Mon Sep 17 00:00:00 2001 From: SHIMODA Hiroshi Date: Wed, 8 Aug 2012 21:25:22 +0900 Subject: [PATCH] Collapse a tree correctly even if a grandchild is focused (#330, regression) --- modules/browser.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/browser.js b/modules/browser.js index f567fda7..45a21e1e 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -5652,9 +5652,10 @@ TreeStyleTabBrowser.prototype = { if (aCollapse && aTab == b.selectedTab && (parent = this.getParentTab(aTab))) { var newSelection = parent; this.getAncestorTabs(aTab).some(function(aAncestor) { - if (!this.isCollapsed(aAncestor)) + if (!this.isCollapsed(aAncestor)) { + newSelection = aAncestor; return true; - newSelection = aAncestor; + } return false; }, this); b.selectedTab = newSelection;