summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/palemoon/base/content/browser-fullScreen.js28
-rw-r--r--application/palemoon/base/content/browser.xul2
2 files changed, 9 insertions, 21 deletions
diff --git a/application/palemoon/base/content/browser-fullScreen.js b/application/palemoon/base/content/browser-fullScreen.js
index 73b10ae85..b302a03e0 100644
--- a/application/palemoon/base/content/browser-fullScreen.js
+++ b/application/palemoon/base/content/browser-fullScreen.js
@@ -5,10 +5,7 @@
var FullScreen = {
_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) {
var enterFS = window.fullScreen;
@@ -31,6 +28,12 @@ var FullScreen = {
document.getElementById("exitFullScreenItem").hidden = !enterFS;
#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
// 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
@@ -50,14 +53,6 @@ var FullScreen = {
this.showXULChrome("toolbar", !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"))
gBrowser.mPanelContainer.addEventListener("mousemove",
this._collapseCallback, false);
@@ -154,11 +149,6 @@ var FullScreen = {
// the toolbar hide immediately.
this._cancelAnimation();
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 () {
@@ -170,8 +160,6 @@ var FullScreen = {
document.removeEventListener("popuphidden", this._setPopupOpen, false);
gPrefService.removeObserver("browser.fullscreen", this);
- this._fullScrToggler.removeEventListener("mouseover", this._expandCallback, false);
- this._fullScrToggler.removeEventListener("dragenter", this._expandCallback, false);
this.cancelWarning();
gBrowser.tabContainer.removeEventListener("TabOpen", this.exitDomFullScreen);
gBrowser.tabContainer.removeEventListener("TabClose", this.exitDomFullScreen);
@@ -502,7 +490,7 @@ var FullScreen = {
gNavToolbox.style.marginTop =
aShow ? "" : -gNavToolbox.getBoundingClientRect().height + "px";
- this._fullScrToggler.collapsed = aShow;
+ this._fullScrToggler.hidden = aShow || document.mozFullScreen;
this._isChromeCollapsed = !aShow;
if (gPrefService.getIntPref("browser.fullscreen.animateUp") == 2)
this._shouldAnimate = true;
diff --git a/application/palemoon/base/content/browser.xul b/application/palemoon/base/content/browser.xul
index c2553f295..9b37f7b6f 100644
--- a/application/palemoon/base/content/browser.xul
+++ b/application/palemoon/base/content/browser.xul
@@ -941,7 +941,7 @@
</toolbarpalette>
</toolbox>
- <hbox id="fullscr-toggler" collapsed="true"/>
+ <hbox id="fullscr-toggler" hidden="true"/>
<hbox flex="1" id="browser">
<vbox id="browser-border-start" hidden="true" layer="true"/>