Merge pull request #925 from upsuper/fix-fullscreen
Fix fullscreen issues #903 and #910
This commit is contained in:
commit
4252c461fd
@ -259,17 +259,33 @@ var TreeStyleTabWindowHelper = {
|
|||||||
));
|
));
|
||||||
}, 'TreeStyleTab');
|
}, 'TreeStyleTab');
|
||||||
|
|
||||||
|
if ('showNavToolbox' in FullScreen) { // for Firefox 40 or later
|
||||||
|
TreeStyleTabUtils.doPatching(FullScreen.showNavToolbox, 'FullScreen.showNavToolbox', function(aName, aSource) {
|
||||||
|
return eval(aName+' = '+aSource.replace(
|
||||||
|
'this._isChromeCollapsed = false;',
|
||||||
|
'gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_FULLSCREEN); $&'
|
||||||
|
));
|
||||||
|
}, '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) {
|
TreeStyleTabUtils.doPatching(FullScreen.mouseoverToggle, 'FullScreen.mouseoverToggle', function(aName, aSource) {
|
||||||
return eval(aName+' = '+aSource.replace(
|
return eval(aName+' = '+aSource.replace(
|
||||||
'this._isChromeCollapsed = !aShow;',
|
'this._isChromeCollapsed = !aShow;',
|
||||||
'gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_FULLSCREEN); $&'
|
'gBrowser.treeStyleTab.updateFloatingTabbar(gBrowser.treeStyleTab.kTABBAR_UPDATE_BY_FULLSCREEN); $&'
|
||||||
));
|
));
|
||||||
}, 'treeStyleTab');
|
}, '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(
|
||||||
'{',
|
'if (enterFS) {',
|
||||||
'{ gBrowser.treeStyleTab.onBeforeFullScreenToggle(); '
|
'gBrowser.treeStyleTab.onBeforeFullScreenToggle(enterFS); $&'
|
||||||
));
|
));
|
||||||
}, 'treeStyleTab');
|
}, 'treeStyleTab');
|
||||||
|
|
||||||
|
@ -5120,17 +5120,16 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
|
|||||||
}).bind(this), 0);
|
}).bind(this), 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
onBeforeFullScreenToggle : function TSTBrowser_onBeforeFullScreenToggle()
|
onBeforeFullScreenToggle : function TSTBrowser_onBeforeFullScreenToggle(aEnterFS)
|
||||||
{
|
{
|
||||||
if (this.position != 'top') {
|
if (this.position != 'top') {
|
||||||
var isEnteringFullScreenMode = !this.window.fullScreen;
|
|
||||||
// entering to the DOM-fullscreen (ex. YouTube Player)
|
// entering to the DOM-fullscreen (ex. YouTube Player)
|
||||||
if (this.document.mozFullScreen && isEnteringFullScreenMode) {
|
if (this.document.mozFullScreen) {
|
||||||
this.setTabbrowserAttribute(this.kDOM_FULLSCREEN_ACTIVATED, true);
|
this.setTabbrowserAttribute(this.kDOM_FULLSCREEN_ACTIVATED, true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (this.document.documentElement.getAttribute(this.kDOM_FULLSCREEN_ACTIVATED) != 'true') {
|
if (this.document.documentElement.getAttribute(this.kDOM_FULLSCREEN_ACTIVATED) != 'true') {
|
||||||
if (isEnteringFullScreenMode)
|
if (aEnterFS)
|
||||||
this.autoHide.startForFullScreen();
|
this.autoHide.startForFullScreen();
|
||||||
else
|
else
|
||||||
this.autoHide.endForFullScreen();
|
this.autoHide.endForFullScreen();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user