Get parent tab correctly
This commit is contained in:
parent
49a025a1da
commit
120dc6b522
@ -437,6 +437,9 @@ var TreeStyleTabUtils = {
|
|||||||
|
|
||||||
getTreeStructureFromTabs : function TSTUtils_getTreeStructureFromTabs(aTabs)
|
getTreeStructureFromTabs : function TSTUtils_getTreeStructureFromTabs(aTabs)
|
||||||
{
|
{
|
||||||
|
if (!aTabs || !aTabs.length)
|
||||||
|
return [];
|
||||||
|
|
||||||
/* this returns...
|
/* this returns...
|
||||||
[A] => -1 (parent is not in this tree)
|
[A] => -1 (parent is not in this tree)
|
||||||
[B] => 0 (parent is 1st item in this tree)
|
[B] => 0 (parent is 1st item in this tree)
|
||||||
@ -445,9 +448,10 @@ var TreeStyleTabUtils = {
|
|||||||
[E] => -1 (parent is not in this tree, and this creates another tree)
|
[E] => -1 (parent is not in this tree, and this creates another tree)
|
||||||
[F] => 0 (parent is 1st item in this another tree)
|
[F] => 0 (parent is 1st item in this another tree)
|
||||||
*/
|
*/
|
||||||
|
var browser = this.getTabBrowserFromChild(aTabs[0]);
|
||||||
return this.cleanUpTreeStructureArray(
|
return this.cleanUpTreeStructureArray(
|
||||||
aTabs.map(function(aTab, aIndex) {
|
aTabs.map(function(aTab, aIndex) {
|
||||||
let tab = this.getParentTab(aTab);
|
let tab = browser.treeStyleTab.getParentTab(aTab);
|
||||||
let index = tab ? aTabs.indexOf(tab) : -1 ;
|
let index = tab ? aTabs.indexOf(tab) : -1 ;
|
||||||
return index >= aIndex ? -1 : index ;
|
return index >= aIndex ? -1 : index ;
|
||||||
}, this),
|
}, this),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user