Fix sidebar in fullscreen mode for Firefox 40+.

This is a change from bug 947854 where FullScreen.mouseoverToggle is
replaced with FullScreen.{show,hide}NavToolbox. This fix detects this
and do patching accordingly.
This commit is contained in:
Xidorn Quan 2015-08-18 12:10:08 +10:00
parent 27efc4311d
commit 075487b836

View File

@ -259,12 +259,28 @@ var TreeStyleTabWindowHelper = {
)); ));
}, 'TreeStyleTab'); }, 'TreeStyleTab');
TreeStyleTabUtils.doPatching(FullScreen.mouseoverToggle, 'FullScreen.mouseoverToggle', function(aName, aSource) { if ('showNavToolbox' in FullScreen) { // for Firefox 40 or later
return eval(aName+' = '+aSource.replace( TreeStyleTabUtils.doPatching(FullScreen.showNavToolbox, 'FullScreen.showNavToolbox', function(aName, aSource) {
'this._isChromeCollapsed = !aShow;', return eval(aName+' = '+aSource.replace(
'gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_FULLSCREEN); $&' 'this._isChromeCollapsed = false;',
)); 'gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_FULLSCREEN); $&'
}, 'treeStyleTab'); ));
}, 'treeStyleTab');
TreeStyleTabUtils.doPatching(FullScreen.hideNavToolbox, 'FullScreen.hideNavToolbox', function(aName, aSource) {
return eval(aName+' = '+aSource.replace(
'this._isChromeCollapsed = true;',
'gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_FULLSCREEN); $&'
));
}, 'treeStyleTab');
}
else if ('mouseoverToggle' in FullScreen) { // for Firefox 39 or older
TreeStyleTabUtils.doPatching(FullScreen.mouseoverToggle, 'FullScreen.mouseoverToggle', function(aName, aSource) {
return eval(aName+' = '+aSource.replace(
'this._isChromeCollapsed = !aShow;',
'gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_FULLSCREEN); $&'
));
}, 'treeStyleTab');
}
TreeStyleTabUtils.doPatching(FullScreen.toggle, 'FullScreen.toggle', function(aName, aSource) { TreeStyleTabUtils.doPatching(FullScreen.toggle, 'FullScreen.toggle', function(aName, aSource) {
return eval(aName+' = '+aSource.replace( return eval(aName+' = '+aSource.replace(