Bug 691320 - typo in GroupItems.newTab from panorama r=tim
authorRaymond Lee <raymond@raysquare.com>
Tue, 04 Oct 2011 17:03:31 +0800
changeset 78723 bce52912af9216aefb10df53a6856c2985071d31
parent 78722 e9152e5f070895c3ac7237dc338d3b14740d4f44
child 78724 1ce1d59084e53fdb8ed9e89637dce43322d9ffc5
push id506
push userclegnitto@mozilla.com
push dateWed, 09 Nov 2011 02:03:18 +0000
treeherdermozilla-aurora@63587fc7bb93 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstim
bugs691320
milestone10.0a1
Bug 691320 - typo in GroupItems.newTab from panorama r=tim
browser/base/content/tabview/groupitems.js
--- a/browser/base/content/tabview/groupitems.js
+++ b/browser/base/content/tabview/groupitems.js
@@ -2372,25 +2372,23 @@ let GroupItems = {
     // tab in question): make a new group
 
     if (activeGroupItem && !activeGroupItem.hidden) {
       activeGroupItem.add(tabItem, options);
       return;
     }
 
     let targetGroupItem;
-    // find first visible non-app tab in the tabbar.
+    // find first non-app visible tab belongs a group, and add the new tabItem
+    // to that group
     gBrowser.visibleTabs.some(function(tab) {
       if (!tab.pinned && tab != tabItem.tab) {
-        if (tab._tabViewTabItem) {
-          if (!tab._tabViewTabItem.parent && !tab._tabViewTabItem.parent.hidden) {
-            // the first visible tab belongs to a group, add the new tabItem to 
-            // that group
-            targetGroupItem = tab._tabViewTabItem.parent;
-          }
+        if (tab._tabViewTabItem && tab._tabViewTabItem.parent &&
+            !tab._tabViewTabItem.parent.hidden) {
+          targetGroupItem = tab._tabViewTabItem.parent;
         }
         return true;
       }
       return false;
     });
 
     let visibleGroupItems;
     if (targetGroupItem) {