起動時のエラーをとりあえず出ないようにした
TODO: * ドラッグ&ドロップ関係の処理が全く動いていない * onTabBarDblClickも乗っ取れていない git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6410 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
2cb8c9d386
commit
bf892a0b1d
@ -343,6 +343,10 @@ var TreeStyleTabService = {
|
|||||||
|
|
||||||
updateTabDNDObserver : function TSTService_updateTabDNDObserver(aObserver)
|
updateTabDNDObserver : function TSTService_updateTabDNDObserver(aObserver)
|
||||||
{
|
{
|
||||||
|
if (aObserver.tabContainer &&
|
||||||
|
aObserver.tabContainer.tabbrowser == aObserver)
|
||||||
|
aObserver = aObserver.tabContainer;
|
||||||
|
|
||||||
if ('_onDragStart' in aObserver) { // Firefox 3.5 or later
|
if ('_onDragStart' in aObserver) { // Firefox 3.5 or later
|
||||||
eval('aObserver._onDragStart = '+
|
eval('aObserver._onDragStart = '+
|
||||||
aObserver._onDragStart.toSource().replace(
|
aObserver._onDragStart.toSource().replace(
|
||||||
@ -355,7 +359,7 @@ var TreeStyleTabService = {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else { // Firefox 3.0.x
|
else if ('onDragStart' in aObserver) { // Firefox 3.0.x
|
||||||
eval('aObserver.onDragStart = '+
|
eval('aObserver.onDragStart = '+
|
||||||
aObserver.onDragStart.toSource().replace( // native
|
aObserver.onDragStart.toSource().replace( // native
|
||||||
'aEvent.target.localName == "tab"',
|
'aEvent.target.localName == "tab"',
|
||||||
@ -372,122 +376,130 @@ var TreeStyleTabService = {
|
|||||||
var canDropFunctionName = '_setEffectAllowedForDataTransfer' in aObserver ?
|
var canDropFunctionName = '_setEffectAllowedForDataTransfer' in aObserver ?
|
||||||
'_setEffectAllowedForDataTransfer' : // Firefox 3.5 or later
|
'_setEffectAllowedForDataTransfer' : // Firefox 3.5 or later
|
||||||
'canDrop' ; // Firefox 3.0.x
|
'canDrop' ; // Firefox 3.0.x
|
||||||
eval('aObserver.'+canDropFunctionName+' = '+
|
if (canDropFunctionName in aObserver) {
|
||||||
aObserver[canDropFunctionName].toSource().replace(
|
eval('aObserver.'+canDropFunctionName+' = '+
|
||||||
'{',
|
aObserver[canDropFunctionName].toSource().replace(
|
||||||
'{ var TSTTabBrowser = this;'
|
'{',
|
||||||
).replace(
|
'{ var TSTTabBrowser = this;'
|
||||||
/\.screenX/g, '[TreeStyleTabService.getTabBrowserFromChild(TSTTabBrowser).treeStyleTab.positionProp]'
|
).replace(
|
||||||
).replace(
|
/\.screenX/g, '[TreeStyleTabService.getTabBrowserFromChild(TSTTabBrowser).treeStyleTab.positionProp]'
|
||||||
/\.width/g, '[TreeStyleTabService.getTabBrowserFromChild(TSTTabBrowser).treeStyleTab.sizeProp]'
|
).replace(
|
||||||
).replace(
|
/\.width/g, '[TreeStyleTabService.getTabBrowserFromChild(TSTTabBrowser).treeStyleTab.sizeProp]'
|
||||||
/(return (?:true|dt.effectAllowed = "copyMove");)/,
|
).replace(
|
||||||
<![CDATA[
|
/(return (?:true|dt.effectAllowed = "copyMove");)/,
|
||||||
if (!this.treeStyleTab.checkCanTabDrop(aEvent, this)) {
|
<![CDATA[
|
||||||
return TST_DRAGDROP_DISALLOW_RETRUN_VALUE;
|
if (!this.treeStyleTab.checkCanTabDrop(aEvent, this)) {
|
||||||
}
|
return TST_DRAGDROP_DISALLOW_RETRUN_VALUE;
|
||||||
$1
|
}
|
||||||
]]>
|
$1
|
||||||
).replace(
|
]]>
|
||||||
/TST_DRAGDROP_DISALLOW_RETRUN_VALUE/g,
|
).replace(
|
||||||
(canDropFunctionName == 'canDrop' ?
|
/TST_DRAGDROP_DISALLOW_RETRUN_VALUE/g,
|
||||||
'false' :
|
(canDropFunctionName == 'canDrop' ?
|
||||||
'dt.effectAllowed = "none"'
|
'false' :
|
||||||
|
'dt.effectAllowed = "none"'
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
);
|
}
|
||||||
|
|
||||||
var dragOverFunctionName = '_onDragOver' in aObserver ?
|
var dragOverFunctionName = '_onDragOver' in aObserver ?
|
||||||
'_onDragOver' : // Firefox 3.5 or later
|
'_onDragOver' : // Firefox 3.5 or later
|
||||||
'onDragOver' ; // Firefox 3.0.x
|
'onDragOver' ; // Firefox 3.0.x
|
||||||
eval('aObserver.'+dragOverFunctionName+' = '+
|
if (dragOverFunctionName in aObserver) {
|
||||||
aObserver[dragOverFunctionName].toSource().replace(
|
eval('aObserver.'+dragOverFunctionName+' = '+
|
||||||
'{',
|
aObserver[dragOverFunctionName].toSource().replace(
|
||||||
<![CDATA[
|
'{',
|
||||||
{
|
<![CDATA[
|
||||||
if (this.treeStyleTab.processTabDragOverEvent(aEvent, this)) {
|
{
|
||||||
return;
|
if (this.treeStyleTab.processTabDragOverEvent(aEvent, this)) {
|
||||||
}
|
return;
|
||||||
]]>
|
}
|
||||||
)
|
]]>
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
var dragExitFunctionName = '_onDragLeave' in aObserver ?
|
var dragExitFunctionName = '_onDragLeave' in aObserver ?
|
||||||
'_onDragLeave' : // Firefox 3.5 or later
|
'_onDragLeave' : // Firefox 3.5 or later
|
||||||
'onDragExit' ; // Firefox 3.0.x
|
'onDragExit' ; // Firefox 3.0.x
|
||||||
eval('aObserver.'+dragExitFunctionName+' = '+
|
if (dragExitFunctionName in aObserver) {
|
||||||
aObserver[dragExitFunctionName].toSource().replace(
|
eval('aObserver.'+dragExitFunctionName+' = '+
|
||||||
/(this.mTabDropIndicatorBar\.[^;]+;)/,
|
aObserver[dragExitFunctionName].toSource().replace(
|
||||||
'$1; this.treeStyleTab.clearDropPosition();'
|
/(this.mTabDropIndicatorBar\.[^;]+;)/,
|
||||||
)
|
'$1; this.treeStyleTab.clearDropPosition();'
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
var dropFunctionName = '_onDrop' in aObserver ?
|
var dropFunctionName = '_onDrop' in aObserver ?
|
||||||
'_onDrop' : // Firefox 3.5 or later
|
'_onDrop' : // Firefox 3.5 or later
|
||||||
'onDrop' ; // Firefox 3.0.x
|
'onDrop' ; // Firefox 3.0.x
|
||||||
eval('aObserver.'+dropFunctionName+' = '+
|
if (dropFunctionName in aObserver) {
|
||||||
aObserver[dropFunctionName].toSource().replace(
|
eval('aObserver.'+dropFunctionName+' = '+
|
||||||
'{',
|
aObserver[dropFunctionName].toSource().replace(
|
||||||
<![CDATA[
|
'{',
|
||||||
{
|
<![CDATA[
|
||||||
var TSTTabBrowser = this;
|
{
|
||||||
TSTTabBrowser.treeStyleTab.clearDropPosition();
|
var TSTTabBrowser = this;
|
||||||
var dropActionInfo = TSTTabBrowser.treeStyleTab.getDropAction(aEvent, TST_DRAGSESSION);
|
TSTTabBrowser.treeStyleTab.clearDropPosition();
|
||||||
]]>
|
var dropActionInfo = TSTTabBrowser.treeStyleTab.getDropAction(aEvent, TST_DRAGSESSION);
|
||||||
).replace( // Firefox 3.0.x, 3.5 or later
|
]]>
|
||||||
/(if \((accelKeyPressed|isCopy|dropEffect == "copy")\) {)/,
|
).replace( // Firefox 3.0.x, 3.5 or later
|
||||||
<![CDATA[
|
/(if \((accelKeyPressed|isCopy|dropEffect == "copy")\) {)/,
|
||||||
if (TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, draggedTab))
|
<![CDATA[
|
||||||
|
if (TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, draggedTab))
|
||||||
|
return;
|
||||||
|
$1]]>
|
||||||
|
).replace( // Firefox 3, duplication of tab
|
||||||
|
/(this.selectedTab = newTab;)(\s*\})?/g,
|
||||||
|
<![CDATA[$1;
|
||||||
|
if (dropActionInfo.position == TreeStyleTabService.kDROP_ON)
|
||||||
|
TSTTabBrowser.treeStyleTab.attachTabTo(newTab, dropActionInfo.target);
|
||||||
|
$2]]>
|
||||||
|
).replace( // Firefox 3, dragging tab from another window
|
||||||
|
'else if (draggedTab) {',
|
||||||
|
<![CDATA[$&
|
||||||
|
if (TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, draggedTab))
|
||||||
|
return;
|
||||||
|
]]>
|
||||||
|
).replace(
|
||||||
|
/(this.loadOneTab\([^;]+\));/,
|
||||||
|
<![CDATA[
|
||||||
|
TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, $1);
|
||||||
return;
|
return;
|
||||||
$1]]>
|
]]>
|
||||||
).replace( // Firefox 3, duplication of tab
|
).replace(
|
||||||
/(this.selectedTab = newTab;)(\s*\})?/g,
|
'document.getBindingParent(aEvent.originalTarget).localName != "tab"',
|
||||||
<![CDATA[$1;
|
'!TreeStyleTabService.getTabFromEvent(aEvent)'
|
||||||
if (dropActionInfo.position == TreeStyleTabService.kDROP_ON)
|
).replace(
|
||||||
TSTTabBrowser.treeStyleTab.attachTabTo(newTab, dropActionInfo.target);
|
'var tab = aEvent.target;',
|
||||||
$2]]>
|
<![CDATA[$&
|
||||||
).replace( // Firefox 3, dragging tab from another window
|
var loadDroppedLinkToNewChildTab = (
|
||||||
'else if (draggedTab) {',
|
dropActionInfo.position != TreeStyleTabService.kDROP_ON ||
|
||||||
<![CDATA[$&
|
tab.getAttribute('locked') == 'true' // Tab Mix Plus (or others)
|
||||||
if (TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, draggedTab))
|
);
|
||||||
return;
|
if (!loadDroppedLinkToNewChildTab &&
|
||||||
]]>
|
dropActionInfo.position == TreeStyleTabService.kDROP_ON) {
|
||||||
).replace(
|
loadDroppedLinkToNewChildTab = TreeStyleTabService.dropLinksOnTabBehavior() == TreeStyleTabService.kDROPLINK_NEWTAB;
|
||||||
/(this.loadOneTab\([^;]+\));/,
|
}
|
||||||
<![CDATA[
|
if (
|
||||||
TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, $1);
|
loadDroppedLinkToNewChildTab ||
|
||||||
return;
|
|
||||||
]]>
|
|
||||||
).replace(
|
|
||||||
'document.getBindingParent(aEvent.originalTarget).localName != "tab"',
|
|
||||||
'!TreeStyleTabService.getTabFromEvent(aEvent)'
|
|
||||||
).replace(
|
|
||||||
'var tab = aEvent.target;',
|
|
||||||
<![CDATA[$&
|
|
||||||
var loadDroppedLinkToNewChildTab = (
|
|
||||||
dropActionInfo.position != TreeStyleTabService.kDROP_ON ||
|
|
||||||
tab.getAttribute('locked') == 'true' // Tab Mix Plus (or others)
|
tab.getAttribute('locked') == 'true' // Tab Mix Plus (or others)
|
||||||
);
|
) {
|
||||||
if (!loadDroppedLinkToNewChildTab &&
|
TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, TSTTabBrowser.loadOneTab(getShortcutOrURI(url), null, null, null, bgLoad, false));
|
||||||
dropActionInfo.position == TreeStyleTabService.kDROP_ON) {
|
return;
|
||||||
loadDroppedLinkToNewChildTab = TreeStyleTabService.dropLinksOnTabBehavior() == TreeStyleTabService.kDROPLINK_NEWTAB;
|
}
|
||||||
}
|
]]>
|
||||||
if (
|
).replace(
|
||||||
loadDroppedLinkToNewChildTab ||
|
/TST_DRAGSESSION/g,
|
||||||
tab.getAttribute('locked') == 'true' // Tab Mix Plus (or others)
|
(canDropFunctionName == 'canDrop' ?
|
||||||
) {
|
'aDragSession' :
|
||||||
TSTTabBrowser.treeStyleTab.performDrop(dropActionInfo, TSTTabBrowser.loadOneTab(getShortcutOrURI(url), null, null, null, bgLoad, false));
|
'TSTTabBrowser.treeStyleTab.getCurrentDragSession()'
|
||||||
return;
|
)
|
||||||
}
|
|
||||||
]]>
|
|
||||||
).replace(
|
|
||||||
/TST_DRAGSESSION/g,
|
|
||||||
(canDropFunctionName == 'canDrop' ?
|
|
||||||
'aDragSession' :
|
|
||||||
'TSTTabBrowser.treeStyleTab.getCurrentDragSession()'
|
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
);
|
}
|
||||||
},
|
},
|
||||||
onTabbarDragStart : function TSTService_onTabbarDragStart(aEvent, aTabBrowser)
|
onTabbarDragStart : function TSTService_onTabbarDragStart(aEvent, aTabBrowser)
|
||||||
{
|
{
|
||||||
|
@ -158,6 +158,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.stopRendering();
|
this.stopRendering();
|
||||||
|
|
||||||
var b = this.mTabBrowser;
|
var b = this.mTabBrowser;
|
||||||
|
b.tabContainer.treeStyleTab = this;
|
||||||
|
|
||||||
this._tabsCache = {};
|
this._tabsCache = {};
|
||||||
|
|
||||||
@ -171,7 +172,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
if (!toggler) {
|
if (!toggler) {
|
||||||
toggler = document.createElement('spacer');
|
toggler = document.createElement('spacer');
|
||||||
toggler.setAttribute('class', this.kTABBAR_TOGGLER);
|
toggler.setAttribute('class', this.kTABBAR_TOGGLER);
|
||||||
this.tabStrip.parentNode.insertBefore(toggler, this.tabStrip);
|
b.mTabBox.insertBefore(toggler, b.mTabBox.firstChild);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -350,13 +351,24 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
|
|
||||||
this.updateTabDNDObserver(b);
|
this.updateTabDNDObserver(b);
|
||||||
|
|
||||||
eval('b.getNewIndex = '+
|
if (b.tabContainer && '_getDropIndex' in b.tabContainer) { // Firefox 3.7 or later
|
||||||
b.getNewIndex.toSource().replace(
|
eval('b.tabContainer._getDropIndex = '+
|
||||||
/\.screenX/g, '[this.treeStyleTab.positionProp]'
|
b.tabContainer._getDropIndex.toSource().replace(
|
||||||
).replace(
|
/\.screenX/g, '[this.treeStyleTab.positionProp]'
|
||||||
/\.width/g, '[this.treeStyleTab.sizeProp]'
|
).replace(
|
||||||
)
|
/\.width/g, '[this.treeStyleTab.sizeProp]'
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else if ('getNewIndex' in b) { // Firefox 3.6 or older
|
||||||
|
eval('b.getNewIndex = '+
|
||||||
|
b.getNewIndex.toSource().replace(
|
||||||
|
/\.screenX/g, '[this.treeStyleTab.positionProp]'
|
||||||
|
).replace(
|
||||||
|
/\.width/g, '[this.treeStyleTab.sizeProp]'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
eval('b.moveTabForward = '+
|
eval('b.moveTabForward = '+
|
||||||
b.moveTabForward.toSource().replace(
|
b.moveTabForward.toSource().replace(
|
||||||
@ -416,6 +428,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
if ('' in b) { // Firefox 3.7-
|
if ('' in b) { // Firefox 3.7-
|
||||||
eval('b._handleKeyEvent = '+
|
eval('b._handleKeyEvent = '+
|
||||||
b._handleKeyEvent.toSource().replace(
|
b._handleKeyEvent.toSource().replace(
|
||||||
@ -445,7 +458,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if ('_keyEventHandler' in b) { // -Firefox 3.6
|
else */if ('_keyEventHandler' in b) { // Firefox 3.6 or older
|
||||||
eval('b._keyEventHandler.handleEvent = '+
|
eval('b._keyEventHandler.handleEvent = '+
|
||||||
b._keyEventHandler.handleEvent.toSource().replace(
|
b._keyEventHandler.handleEvent.toSource().replace(
|
||||||
'this.tabbrowser.moveTabOver(aEvent);',
|
'this.tabbrowser.moveTabOver(aEvent);',
|
||||||
@ -510,12 +523,14 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
eval('b.onTabBarDblClick = '+
|
if ('onTabBarDblClick' in b) { // Firefox 3.6 or older
|
||||||
b.onTabBarDblClick.toSource().replace(
|
eval('b.onTabBarDblClick = '+
|
||||||
'aEvent.originalTarget.localName == "box"',
|
b.onTabBarDblClick.toSource().replace(
|
||||||
'/^(box|(arrow)?scrollbox|tabs)$/.test(aEvent.originalTarget.localName)'
|
'aEvent.originalTarget.localName == "box"',
|
||||||
)
|
'/^(box|(arrow)?scrollbox|tabs)$/.test(aEvent.originalTarget.localName)'
|
||||||
);
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if ('_onDragEnd' in b) {
|
if ('_onDragEnd' in b) {
|
||||||
eval('b._onDragEnd = '+b._onDragEnd.toSource().replace(
|
eval('b._onDragEnd = '+b._onDragEnd.toSource().replace(
|
||||||
@ -569,7 +584,8 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.onPrefChange('extensions.treestyletab.tabbar.invertTabContents');
|
this.onPrefChange('extensions.treestyletab.tabbar.invertTabContents');
|
||||||
this.onPrefChange('extensions.treestyletab.tabbar.invertClosebox');
|
this.onPrefChange('extensions.treestyletab.tabbar.invertClosebox');
|
||||||
|
|
||||||
var tabContextMenu = document.getAnonymousElementByAttribute(b, 'anonid', 'tabContextMenu');
|
var tabContextMenu = document.getAnonymousElementByAttribute(b, 'anonid', 'tabContextMenu') ||
|
||||||
|
document.getAnonymousElementByAttribute(b.tabContainer, 'anonid', 'tabContextMenu');
|
||||||
tabContextMenu.addEventListener('popupshowing', this, false);
|
tabContextMenu.addEventListener('popupshowing', this, false);
|
||||||
if (!('MultipleTabService' in window)) {
|
if (!('MultipleTabService' in window)) {
|
||||||
window.setTimeout(function(aSelf, aTabBrowser, aPopup) {
|
window.setTimeout(function(aSelf, aTabBrowser, aPopup) {
|
||||||
@ -855,6 +871,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
var strip = this.tabStrip;
|
var strip = this.tabStrip;
|
||||||
var splitter = this._ensureNewSplitter();
|
var splitter = this._ensureNewSplitter();
|
||||||
var toggler = document.getAnonymousElementByAttribute(b, 'class', this.kTABBAR_TOGGLER);
|
var toggler = document.getAnonymousElementByAttribute(b, 'class', this.kTABBAR_TOGGLER);
|
||||||
|
var indicator = b.mTabDropIndicatorBar || b.tabContainer._tabDropIndicator;
|
||||||
|
|
||||||
// Tab Mix Plus
|
// Tab Mix Plus
|
||||||
var scrollFrame, newTabBox, tabBarMode;
|
var scrollFrame, newTabBox, tabBarMode;
|
||||||
@ -939,7 +956,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
unexpectedly becomes 0 on the startup. so, we have
|
unexpectedly becomes 0 on the startup. so, we have
|
||||||
to set the width again. */
|
to set the width again. */
|
||||||
strip.setAttribute('width', aSelf.getTreePref('tabbar.width'));
|
strip.setAttribute('width', aSelf.getTreePref('tabbar.width'));
|
||||||
aTabBrowser.mTabDropIndicatorBar.setAttribute('ordinal', 1);
|
indicator.setAttribute('ordinal', 1);
|
||||||
strip.setAttribute('ordinal', 30);
|
strip.setAttribute('ordinal', 30);
|
||||||
aSplitter.setAttribute('ordinal', 20);
|
aSplitter.setAttribute('ordinal', 20);
|
||||||
aToggler.setAttribute('ordinal', 40);
|
aToggler.setAttribute('ordinal', 40);
|
||||||
@ -952,7 +969,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.setTabbarAttribute(this.kTAB_INVERTED, null, b);
|
this.setTabbarAttribute(this.kTAB_INVERTED, null, b);
|
||||||
this.indentTarget = 'left';
|
this.indentTarget = 'left';
|
||||||
delayedPostProcess = function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
delayedPostProcess = function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
||||||
aTabBrowser.mTabDropIndicatorBar.setAttribute('ordinal', 1);
|
indicator.setAttribute('ordinal', 1);
|
||||||
strip.setAttribute('ordinal', 10);
|
strip.setAttribute('ordinal', 10);
|
||||||
aSplitter.setAttribute('ordinal', 20);
|
aSplitter.setAttribute('ordinal', 20);
|
||||||
aToggler.setAttribute('ordinal', 5);
|
aToggler.setAttribute('ordinal', 5);
|
||||||
@ -998,7 +1015,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.setTabbarAttribute(this.kTABBAR_POSITION, 'bottom', b);
|
this.setTabbarAttribute(this.kTABBAR_POSITION, 'bottom', b);
|
||||||
this.indentTarget = 'bottom';
|
this.indentTarget = 'bottom';
|
||||||
delayedPostProcess = function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
delayedPostProcess = function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
||||||
aTabBrowser.mTabDropIndicatorBar.setAttribute('ordinal', 1);
|
indicator.setAttribute('ordinal', 1);
|
||||||
strip.setAttribute('ordinal', 30);
|
strip.setAttribute('ordinal', 30);
|
||||||
aSplitter.setAttribute('ordinal', 20);
|
aSplitter.setAttribute('ordinal', 20);
|
||||||
aToggler.setAttribute('ordinal', 40);
|
aToggler.setAttribute('ordinal', 40);
|
||||||
@ -1009,7 +1026,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
this.setTabbarAttribute(this.kTABBAR_POSITION, 'top', b);
|
this.setTabbarAttribute(this.kTABBAR_POSITION, 'top', b);
|
||||||
this.indentTarget = 'top';
|
this.indentTarget = 'top';
|
||||||
delayedPostProcess = function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
delayedPostProcess = function(aSelf, aTabBrowser, aSplitter, aToggler) {
|
||||||
aTabBrowser.mTabDropIndicatorBar.setAttribute('ordinal', 1);
|
indicator.setAttribute('ordinal', 1);
|
||||||
strip.setAttribute('ordinal', 10);
|
strip.setAttribute('ordinal', 10);
|
||||||
aSplitter.setAttribute('ordinal', 20);
|
aSplitter.setAttribute('ordinal', 20);
|
||||||
aToggler.setAttribute('ordinal', 5);
|
aToggler.setAttribute('ordinal', 5);
|
||||||
@ -1158,6 +1175,7 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
delete this._autoHide;
|
delete this._autoHide;
|
||||||
|
|
||||||
var b = this.mTabBrowser;
|
var b = this.mTabBrowser;
|
||||||
|
delete b.tabContainer.treeStyleTab;
|
||||||
|
|
||||||
this.getTabsArray(b).forEach(function(aTab) {
|
this.getTabsArray(b).forEach(function(aTab) {
|
||||||
this.destroyTab(aTab);
|
this.destroyTab(aTab);
|
||||||
|
@ -789,14 +789,18 @@ var TreeStyleTabUtils = {
|
|||||||
|
|
||||||
getTabBrowserFromChild : function TSTUtils_getTabBrowserFromChild(aTabBrowserChild)
|
getTabBrowserFromChild : function TSTUtils_getTabBrowserFromChild(aTabBrowserChild)
|
||||||
{
|
{
|
||||||
if (!aTabBrowserChild) return null;
|
if (!aTabBrowserChild)
|
||||||
|
return null;
|
||||||
|
|
||||||
if (aTabBrowserChild.__treestyletab__linkedTabBrowser)
|
if (aTabBrowserChild.__treestyletab__linkedTabBrowser) // tab
|
||||||
return aTabBrowserChild.__treestyletab__linkedTabBrowser;
|
return aTabBrowserChild.__treestyletab__linkedTabBrowser;
|
||||||
|
|
||||||
if (aTabBrowserChild.localName == 'tabbrowser')
|
if (aTabBrowserChild.localName == 'tabbrowser') // itself
|
||||||
return aTabBrowserChild;
|
return aTabBrowserChild;
|
||||||
|
|
||||||
|
if (aTabBrowserChild.tabbrowser) // tabs, Firefox 3.7 or later
|
||||||
|
return aTabBrowserChild.tabbrowser;
|
||||||
|
|
||||||
var b = this.evaluateXPath(
|
var b = this.evaluateXPath(
|
||||||
'ancestor::xul:tabbrowser | '+
|
'ancestor::xul:tabbrowser | '+
|
||||||
'ancestor::xul:tabs[@tabbrowser]',
|
'ancestor::xul:tabs[@tabbrowser]',
|
||||||
|
Loading…
Reference in New Issue
Block a user