mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-31 11:37:30 +09:00
[PALEMOON] fullscr-toggler element needs to be hidden in DOM fullscreen
This commit is contained in:
parent
5975ed3076
commit
f42005f392
2 changed files with 9 additions and 21 deletions
|
|
@ -5,10 +5,7 @@
|
||||||
|
|
||||||
var FullScreen = {
|
var FullScreen = {
|
||||||
_XULNS: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
|
_XULNS: "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
|
||||||
get _fullScrToggler() {
|
|
||||||
delete this._fullScrToggler;
|
|
||||||
return this._fullScrToggler = document.getElementById("fullscr-toggler");
|
|
||||||
},
|
|
||||||
toggle: function (event) {
|
toggle: function (event) {
|
||||||
var enterFS = window.fullScreen;
|
var enterFS = window.fullScreen;
|
||||||
|
|
||||||
|
|
@ -31,6 +28,12 @@ var FullScreen = {
|
||||||
document.getElementById("exitFullScreenItem").hidden = !enterFS;
|
document.getElementById("exitFullScreenItem").hidden = !enterFS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (!this._fullScrToggler) {
|
||||||
|
this._fullScrToggler = document.getElementById("fullscr-toggler");
|
||||||
|
this._fullScrToggler.addEventListener("mouseover", this._expandCallback, false);
|
||||||
|
this._fullScrToggler.addEventListener("dragenter", this._expandCallback, false);
|
||||||
|
}
|
||||||
|
|
||||||
// On OS X Lion we don't want to hide toolbars when entering fullscreen, unless
|
// On OS X Lion we don't want to hide toolbars when entering fullscreen, unless
|
||||||
// we're entering DOM fullscreen, in which case we should hide the toolbars.
|
// we're entering DOM fullscreen, in which case we should hide the toolbars.
|
||||||
// If we're leaving fullscreen, then we'll go through the exit code below to
|
// If we're leaving fullscreen, then we'll go through the exit code below to
|
||||||
|
|
@ -50,14 +53,6 @@ var FullScreen = {
|
||||||
this.showXULChrome("toolbar", !enterFS);
|
this.showXULChrome("toolbar", !enterFS);
|
||||||
|
|
||||||
if (enterFS) {
|
if (enterFS) {
|
||||||
// Add a tiny toolbar to receive mouseover and dragenter events, and provide affordance.
|
|
||||||
// This will help simulate the "collapse" metaphor while also requiring less code and
|
|
||||||
// events than raw listening of mouse coords. We don't add the toolbar in DOM full-screen
|
|
||||||
// mode, only browser full-screen mode.
|
|
||||||
if (!document.mozFullScreen) {
|
|
||||||
this._fullScrToggler.addEventListener("mouseover", this._expandCallback, false);
|
|
||||||
this._fullScrToggler.addEventListener("dragenter", this._expandCallback, false);
|
|
||||||
}
|
|
||||||
if (gPrefService.getBoolPref("browser.fullscreen.autohide"))
|
if (gPrefService.getBoolPref("browser.fullscreen.autohide"))
|
||||||
gBrowser.mPanelContainer.addEventListener("mousemove",
|
gBrowser.mPanelContainer.addEventListener("mousemove",
|
||||||
this._collapseCallback, false);
|
this._collapseCallback, false);
|
||||||
|
|
@ -154,11 +149,6 @@ var FullScreen = {
|
||||||
// the toolbar hide immediately.
|
// the toolbar hide immediately.
|
||||||
this._cancelAnimation();
|
this._cancelAnimation();
|
||||||
this.mouseoverToggle(false);
|
this.mouseoverToggle(false);
|
||||||
|
|
||||||
// Remove listeners on the full-screen toggler, so that mouseover
|
|
||||||
// the top of the screen will not cause the toolbar to re-appear.
|
|
||||||
this._fullScrToggler.removeEventListener("mouseover", this._expandCallback, false);
|
|
||||||
this._fullScrToggler.removeEventListener("dragenter", this._expandCallback, false);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
cleanup: function () {
|
cleanup: function () {
|
||||||
|
|
@ -170,8 +160,6 @@ var FullScreen = {
|
||||||
document.removeEventListener("popuphidden", this._setPopupOpen, false);
|
document.removeEventListener("popuphidden", this._setPopupOpen, false);
|
||||||
gPrefService.removeObserver("browser.fullscreen", this);
|
gPrefService.removeObserver("browser.fullscreen", this);
|
||||||
|
|
||||||
this._fullScrToggler.removeEventListener("mouseover", this._expandCallback, false);
|
|
||||||
this._fullScrToggler.removeEventListener("dragenter", this._expandCallback, false);
|
|
||||||
this.cancelWarning();
|
this.cancelWarning();
|
||||||
gBrowser.tabContainer.removeEventListener("TabOpen", this.exitDomFullScreen);
|
gBrowser.tabContainer.removeEventListener("TabOpen", this.exitDomFullScreen);
|
||||||
gBrowser.tabContainer.removeEventListener("TabClose", this.exitDomFullScreen);
|
gBrowser.tabContainer.removeEventListener("TabClose", this.exitDomFullScreen);
|
||||||
|
|
@ -502,7 +490,7 @@ var FullScreen = {
|
||||||
gNavToolbox.style.marginTop =
|
gNavToolbox.style.marginTop =
|
||||||
aShow ? "" : -gNavToolbox.getBoundingClientRect().height + "px";
|
aShow ? "" : -gNavToolbox.getBoundingClientRect().height + "px";
|
||||||
|
|
||||||
this._fullScrToggler.collapsed = aShow;
|
this._fullScrToggler.hidden = aShow || document.mozFullScreen;
|
||||||
this._isChromeCollapsed = !aShow;
|
this._isChromeCollapsed = !aShow;
|
||||||
if (gPrefService.getIntPref("browser.fullscreen.animateUp") == 2)
|
if (gPrefService.getIntPref("browser.fullscreen.animateUp") == 2)
|
||||||
this._shouldAnimate = true;
|
this._shouldAnimate = true;
|
||||||
|
|
|
||||||
|
|
@ -941,7 +941,7 @@
|
||||||
</toolbarpalette>
|
</toolbarpalette>
|
||||||
</toolbox>
|
</toolbox>
|
||||||
|
|
||||||
<hbox id="fullscr-toggler" collapsed="true"/>
|
<hbox id="fullscr-toggler" hidden="true"/>
|
||||||
|
|
||||||
<hbox flex="1" id="browser">
|
<hbox flex="1" id="browser">
|
||||||
<vbox id="browser-border-start" hidden="true" layer="true"/>
|
<vbox id="browser-border-start" hidden="true" layer="true"/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue