Tab Mix Plusでブックマークグループを開いた時にツリーが壊れる問題を修正

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1572 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2007-11-13 04:12:08 +00:00
parent f13d6137d3
commit 625aa8a334
2 changed files with 35 additions and 3 deletions

View File

@ -258,11 +258,32 @@ TreeStyleTabService.overrideExtensions = function() {
eval('TMP_Bookmark.openGroup = '+
TMP_Bookmark.openGroup.toSource().replace(
/(tabToSelect = aTab;)/,
'$1 TreeStyleTabService.readyToOpenChildTab(tabToSelect, true);'
/(var tabToSelect = null;)/,
<><![CDATA[
$1
browser.__treestyletab__internallyTabMoving = true;
]]></>
).replace(
'index = prevTab._tPos + 1;',
<><![CDATA[
index = TreeStyleTabService.getNextSiblingTab(TreeStyleTabService.getRootTab(prevTab));
if (tabToSelect == aTab) index = TreeStyleTabService.getNextSiblingTab(index);
index = index ? index._tPos : (prevTab._tPos + 1);
]]></>
).replace(
/(prevTab = aTab;)/,
<><![CDATA[
$1
if (tabToSelect == aTab) {
TreeStyleTabService.readyToOpenChildTab(tabToSelect, true, TreeStyleTabService.getNextSiblingTab(tabToSelect));
}
]]></>
).replace(
/(browser.mTabContainer.nextTab)/,
'TreeStyleTabService.stopToOpenChildTab(tabToSelect); $1'
<><![CDATA[
TreeStyleTabService.stopToOpenChildTab(tabToSelect);
browser.__treestyletab__internallyTabMoving = false;
$1]]></>
)
);

View File

@ -1854,6 +1854,17 @@ catch(e) {
).singleNodeValue;
},
getRootTab : function(aTab)
{
var parent = aTab;
var root = aTab;
while (parent = this.getParentTab(parent))
{
root = parent;
}
return root;
},
getNextSiblingTab : function(aTab)
{
if (!aTab) return null;