make extensions.treestyletab.autoAttachSearchResultAsChildren tribool

This commit is contained in:
SHIMODA Hiroshi 2010-12-09 20:13:04 +09:00
parent e1e7476db4
commit 328e3df340
2 changed files with 10 additions and 3 deletions

View File

@ -145,10 +145,11 @@ var TreeStyleTabService = {
shouldOpenSearchResultAsChild : function TSTService_shouldOpenSearchResultAsChild(aTerm)
{
if (this.getTreePref('autoAttachSearchResultAsChildren.always'))
var mode = this.getTreePref('autoAttachSearchResultAsChildren');
if (mode == this.kSEARCH_RESULT_ATTACH_ALWAYS)
return true;
if (!aTerm)
if (!aTerm || mode == this.kSEARCH_RESULT_DO_NOT_ATTACH)
return false;
var w = document.commandDispatcher.focusedWindow;
@ -161,6 +162,9 @@ var TreeStyleTabService = {
return Array.slice(aWindow.frames).some(arguments.callee);
})(w);
},
kSEARCH_RESULT_DO_NOT_ATTACH : 0,
kSEARCH_RESULT_ATTACH_IF_SELECTED : 1,
kSEARCH_RESULT_ATTACH_ALWAYS : 2,
/* Initializing */

View File

@ -108,7 +108,10 @@ pref("extensions.treestyletab.collapseExpandSubtree.dblclick", false);
pref("extensions.treestyletab.autoExpandSubtreeOnCollapsedChildFocused", true);
pref("extensions.treestyletab.autoExpandSubtreeOnAppendChild", true);
pref("extensions.treestyletab.autoAttachNewTabsAsChildren", true);
pref("extensions.treestyletab.autoAttachSearchResultAsChildren.always", false);
// 0 = don't attach
// 1 = attach if the search term equals to the selection in the current tab
// 2 = always attach
pref("extensions.treestyletab.autoAttachSearchResultAsChildren", 1);
// 0 = default, 1 = only visible tabs
pref("extensions.treestyletab.focusMode", 1);
/*