From d3ddb7c9055f411836b1fb4cbdbe91e8b924e9da Mon Sep 17 00:00:00 2001 From: Raymond Lee Date: Thu, 19 Aug 2010 17:13:58 +0800 Subject: [PATCH] Bug 588478 - Escape should not open tab from fan view of stacked tabs [r=dolske a=dolske] --HG-- extra : rebase_source : 1a77634fa20cc1bfb42d816dfe2551809f03f116 --- browser/base/content/tabview/ui.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/browser/base/content/tabview/ui.js b/browser/base/content/tabview/ui.js index 707e86815bf..bcc86761704 100644 --- a/browser/base/content/tabview/ui.js +++ b/browser/base/content/tabview/ui.js @@ -608,10 +608,15 @@ var UIManager = { } else if (event.keyCode == KeyEvent.DOM_VK_ESCAPE || event.keyCode == KeyEvent.DOM_VK_RETURN || event.keyCode == KeyEvent.DOM_VK_ENTER) { - // esc or return to zoom into the active tab. - var activeTab = self.getActiveTab(); - if (activeTab) - activeTab.zoomIn(); + let activeTab = self.getActiveTab(); + let activeGroupItem = GroupItems.getActiveGroupItem(); + + if (activeGroupItem && activeGroupItem.expanded && + event.keyCode == KeyEvent.DOM_VK_ESCAPE) + activeGroupItem.collapse(); + else if (activeTab) + activeTab.zoomIn(); + event.stopPropagation(); event.preventDefault(); } else if (event.keyCode == KeyEvent.DOM_VK_TAB) {