quick touchup to GroupItems.getnextGroupItemTab
authorMichael Yoshitaka Erlewine <mitcho@mitcho.com>
Sun, 08 Aug 2010 23:41:07 -0400
changeset 50272 97771c78cee1a50831eafd743f7ecc5157ae1975
parent 50271 8423ffb1910f53df2feee31b8c9711e2b1faaca6
child 50273 cc4f35ed416c8d0f137a5457128fcaa83fa9565d
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b4pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
quick touchup to GroupItems.getnextGroupItemTab
browser/base/content/tabview/groupitems.js
--- a/browser/base/content/tabview/groupitems.js
+++ b/browser/base/content/tabview/groupitems.js
@@ -1702,24 +1702,25 @@ window.GroupItems = {
   },
 
   // ----------
   // Function: getNextGroupItemTab
   // Paramaters:
   //  reverse - the boolean indicates the direction to look for the next groupItem.
   // Returns the <tabItem>. If nothing is found, return null.
   getNextGroupItemTab: function(reverse) {
-    var groupItems = GroupItems.groupItems.map(function(groupItem) groupItem);
+    var groupItems = Utils.copy(GroupItems.groupItems);
+    if (reverse)
+      groupItems = groupItems.reverse();
     var activeGroupItem = GroupItems.getActiveGroupItem();
+    var activeOrphanTab = GroupItems.getActiveOrphanTab();
     var tabItem = null;
 
     if (!activeGroupItem) {
       if (groupItems.length > 0) {
-        if (reverse)
-          groupItems = groupItems.reverse();
 
         groupItems.some(function(groupItem) {
           var child = groupItem.getChild(0);
           if (child) {
             tabItem = child;
             return true;
           }
         });