@@ -70,6 +70,7 @@ var TabGroup = Module("tabGroup", {
70
70
else
71
71
test = function ( g ) g . getTitle ( ) . toLowerCase ( ) == name ;
72
72
}
73
+ // Using shim, iterate tabView.GroupItems itself
73
74
for ( let group of this . tabView . GroupItems . groupItems ) {
74
75
if ( test ( group ) ) {
75
76
i ++ ;
@@ -90,8 +91,9 @@ var TabGroup = Module("tabGroup", {
90
91
return ;
91
92
92
93
const GI = tabGroup . tabView . GroupItems ;
93
- let current = GI . getActiveGroupItem ( ) || GI . getActiveOrphanTab ( ) ;
94
- let groups = GI . groupItems ;
94
+ // getActiveOrphanTab no longer exists in Tab Groups 2
95
+ let current = GI . getActiveGroupItem ( ) || ( GI . getActiveOrphanTab && GI . getActiveOrphanTab ( ) ) ;
96
+ let groups = GI . groupItems ; // Using shim, use GroupItems.sortBySlot()
95
97
let offset = 1 , relative = false , index ;
96
98
if ( typeof spec === "number" )
97
99
index = parseInt ( spec , 10 ) ;
@@ -159,11 +161,7 @@ var TabGroup = Module("tabGroup", {
159
161
if ( ! tabGroup . TV )
160
162
return null ;
161
163
162
- let pageBounds = tabGroup . tabView . Items . getPageBounds ( ) ;
163
- pageBounds . inset ( 20 , 20 ) ;
164
- let box = new tabGroup . tabView . Rect ( pageBounds ) ;
165
- box . width = 125 ;
166
- box . height = 110 ;
164
+ let box = new tabGroup . tabView . Rect ( 20 , 20 , 125 , 110 ) ;
167
165
let group = new tabGroup . tabView . GroupItem ( [ ] , { bounds : box , title : name } ) ;
168
166
169
167
if ( tab && ! tab . pinned )
@@ -439,15 +437,15 @@ var TabGroup = Module("tabGroup", {
439
437
}
440
438
441
439
const GI = tabGroup . tabView . GroupItems ;
442
- let groupItems = GI . groupItems ;
440
+ let groupItems = GI . groupItems ; // Using shim, use GroupItems.sortBySlot()
443
441
if ( excludeActiveGroup ) {
444
442
let activeGroup = GI . getActiveGroupItem ( ) ;
445
443
if ( activeGroup )
446
444
groupItems = groupItems . filter ( function ( group ) group . id != activeGroup . id ) ;
447
445
}
448
446
context . completions = groupItems . map ( function ( group ) {
449
447
let title = group . id + ": " + ( group . getTitle ( ) || "(Untitled)" ) ;
450
- let desc = "Tabs: " + group . getChildren ( ) . length ;
448
+ let desc = "Tabs: " + group . getChildren ( ) . length ; // Using shim, use group.children
451
449
452
450
return [ title , desc ] ;
453
451
} ) ;
0 commit comments