Update hacks about moveTabForward/moveTabBackward for Firefox 20
This commit is contained in:
parent
d7d988ee96
commit
318ad0ee52
@ -398,23 +398,30 @@ var TreeStyleTabWindowHelper = {
|
||||
{
|
||||
var b = aTabBrowser;
|
||||
|
||||
eval('b.moveTabForward = '+
|
||||
b.moveTabForward.toSource().replace(
|
||||
let (source = b.moveTabForward.toSource()) {
|
||||
if (source.indexOf('nextTab.hidden') < 0) { // Firefox 19 or olders
|
||||
source = source.replace(
|
||||
'{', '{ var nextTab;'
|
||||
).replace(
|
||||
'tabPos < this.browsers.length - 1',
|
||||
'nextTab = this.treeStyleTab.getNextSiblingTab(this.mCurrentTab)'
|
||||
).replace(
|
||||
'tabPos + 1', 'nextTab._tPos'
|
||||
).replace(
|
||||
'this.moveTabTo(',
|
||||
);
|
||||
}
|
||||
eval('b.moveTabForward = '+
|
||||
source.replace(
|
||||
/(this.moveTabTo\([^;]+\);)/,
|
||||
'(function() {\n' +
|
||||
' var descendant = this.treeStyleTab.getDescendantTabs(nextTab);\n' +
|
||||
' if (descendant.length) {\n' +
|
||||
' nextTab = descendant[descendant.length-1];\n' +
|
||||
' }\n' +
|
||||
'$&'
|
||||
' $1\n' +
|
||||
'}).call(this);'
|
||||
).replace(
|
||||
'this.moveTabToStart();',
|
||||
'(function() {\n' +
|
||||
' this.treeStyleTab.internallyTabMovingCount++;\n' +
|
||||
' var parentTab = this.treeStyleTab.getParentTab(this.mCurrentTab);\n' +
|
||||
' if (parentTab) {\n' +
|
||||
@ -424,20 +431,27 @@ var TreeStyleTabWindowHelper = {
|
||||
' else {\n' +
|
||||
' $&\n' +
|
||||
' }\n' +
|
||||
'this.treeStyleTab.internallyTabMovingCount--;'
|
||||
' this.treeStyleTab.internallyTabMovingCount--;\n' +
|
||||
'}).call(this);'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
eval('b.moveTabBackward = '+
|
||||
b.moveTabBackward.toSource().replace(
|
||||
let (source = b.moveTabBackward.toSource()) {
|
||||
if (source.indexOf('prevTab.hidden') < 0) { // Firefox 19 or olders
|
||||
source = source.replace(
|
||||
'{', '{ var prevTab;'
|
||||
).replace(
|
||||
'tabPos > 0',
|
||||
'prevTab = this.treeStyleTab.getPreviousSiblingTab(this.mCurrentTab)'
|
||||
).replace(
|
||||
'tabPos - 1', 'prevTab._tPos'
|
||||
).replace(
|
||||
);
|
||||
}
|
||||
eval('b.moveTabBackward = '+
|
||||
source.replace(
|
||||
'this.moveTabToEnd();',
|
||||
'(function() {\n' +
|
||||
' this.treeStyleTab.internallyTabMovingCount++;\n' +
|
||||
' var parentTab = this.treeStyleTab.getParentTab(this.mCurrentTab);\n' +
|
||||
' if (parentTab) {\n' +
|
||||
@ -447,9 +461,11 @@ var TreeStyleTabWindowHelper = {
|
||||
' else {\n' +
|
||||
' $&\n' +
|
||||
' }\n' +
|
||||
'this.treeStyleTab.internallyTabMovingCount--;'
|
||||
' this.treeStyleTab.internallyTabMovingCount--;\n' +
|
||||
'}).call(this);'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
eval('b.loadTabs = '+
|
||||
b.loadTabs.toSource().replace(
|
||||
|
Loading…
Reference in New Issue
Block a user