Open "next sibling tab" more correctly in some cases.

See:
https://github.com/piroor/treestyletab/issues/1143
https://github.com/piroor/treestyletab/issues/1150
This commit is contained in:
YUKI Hiroshi 2016-09-09 15:42:24 +09:00
parent 64aa470ea2
commit 81e2c10ed5

View File

@ -1411,8 +1411,18 @@ var TreeStyleTabBase = inherit(TreeStyleTabConstants, {
if (!tab || tab.getAttribute('pinned') == 'true') if (!tab || tab.getAttribute('pinned') == 'true')
return false; return false;
var nextTab = (function findNextSiblingTab(aTab) {
if (!aTab)
return null;
var nextTab = this.getNextSiblingTab(aTab);
if (nextTab)
return nextTab;
return findNextSiblingTab.call(this, this.getParentTab(aTab));
}).call(this, tab);
var parentTab = this.getParentTab(tab); var parentTab = this.getParentTab(tab);
var nextTab = this.getNextSiblingTab(tab) || this.getNextTab(tab);
if (parentTab) { if (parentTab) {
/** /**
* If the base tab has a parent, open the new tab as a child of * If the base tab has a parent, open the new tab as a child of