From 81e2c10ed58f98ab32668d81d1289d5d1304c56a Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Fri, 9 Sep 2016 15:42:24 +0900 Subject: [PATCH] Open "next sibling tab" more correctly in some cases. See: https://github.com/piroor/treestyletab/issues/1143 https://github.com/piroor/treestyletab/issues/1150 --- modules/base.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/base.js b/modules/base.js index 71b2faec..86ffed2e 100644 --- a/modules/base.js +++ b/modules/base.js @@ -1411,8 +1411,18 @@ var TreeStyleTabBase = inherit(TreeStyleTabConstants, { if (!tab || tab.getAttribute('pinned') == 'true') 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 nextTab = this.getNextSiblingTab(tab) || this.getNextTab(tab); if (parentTab) { /** * If the base tab has a parent, open the new tab as a child of