[Pkg-mozext-commits] [all-in-one-sidebar] 08/49: Major: follow-up #2 sidebar switch and toolbar visible in fullscreen mode when playing HTML5 videos
David Prévot
taffit at moszumanska.debian.org
Fri Sep 19 16:46:32 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository all-in-one-sidebar.
commit 74d16f72a31a76788b5da284f2cc5c5b3c1c79b1
Author: Ingo Wennemaring <github at addonlab.com>
Date: Sun Aug 4 16:53:45 2013 +0200
Major: follow-up #2 sidebar switch and toolbar visible in fullscreen mode when playing HTML5 videos
uses now the 'mozfullscreenchange' event instead of the 'sizemodechange' event; making sure that all elements will restore correctly
---
content/aios.js | 43 ++++++++++++++++++++++++++++++-------------
1 file changed, 30 insertions(+), 13 deletions(-)
diff --git a/content/aios.js b/content/aios.js
index e681df2..0162c73 100644
--- a/content/aios.js
+++ b/content/aios.js
@@ -4,6 +4,7 @@
window.addEventListener("load", aios_initSidebar, false);
window.addEventListener("resize", aios_checkThinSwitch, false);
+window.addEventListener("mozfullscreenchange", aios_BrowserFullScreen, false);
// sonst werden neu definierte Shortcuts bei Browser-Neustart zurueckgesetzt
extLoad.add(30, function() {
@@ -16,6 +17,8 @@ var fx_mainWindow, fx_browser, fx_sidebar, fx_sidebarBox, fx_sidebarHeader, fx_s
var aios_toggleBox, aios_toggleBar, aios_toggleSwitchItem, aios_toggleToolbarItem, aios_toolbar;
var elem_switch, elem_tbb, elem_key, elem_close, elem_close2;
+var aios_enterFullScreen = 0;
+var aios_leaveFullScreen = 0;
// Sidebar nur zusammenklappen statt schliessen
var aios_collapseSidebar = aios_gPrefBranch.getBoolPref('collapse');
@@ -202,9 +205,6 @@ function aios_initSidebar() {
// Sidebar-Ladezustand ueberwachen
/*document.getElementById('sidebar').addProgressListener(aiosSBListener, Components.interfaces.nsIWebProgress.NOTIFY_STATE_DOCUMENT);*/
- // BrowserFullScreen überwachen
- window.addEventListener( "sizemodechange", aios_BrowserFullScreen );
-
// Drag&Drop-Funktion fuer den Sidebar-Umschalter deaktivieren?
try {
var switchDrag = aios_gPrefBranch.getBoolPref("gen.switch.drag");
@@ -730,16 +730,7 @@ function aios_BrowserFullScreen() {
aios_getObjects();
try {
- // Soll-Zustaende
- var close_switch = aios_gPrefBranch.getBoolPref('fs.switch');
- var close_toolbar = aios_gPrefBranch.getBoolPref('fs.toolbar');
- var close_sidebar = aios_gPrefBranch.getBoolPref('fs.sidebar');
var enable_restore = aios_gPrefBranch.getBoolPref('fs.restore');
-
- // Ist-Zustaende
- var rem_switchHidden = aios_getBoolean(aios_toggleBox, 'hidden');
- var rem_toolbarHidden = aios_getBoolean(aios_toolbar, 'hidden');
- var rem_sidebarHidden = aios_isSidebarHidden();
}
catch(e) {
return false;
@@ -747,7 +738,27 @@ function aios_BrowserFullScreen() {
// Fullscreen an
// => Elemente ausblenden
- if(window.fullScreen) {
+ if(document.mozFullScreenElement) {
+
+ // Fix für mehrmaliges feuern des mozfullscreenchange events
+ aios_leaveFullScreen = 0;
+ aios_enterFullScreen++;
+ if(aios_enterFullScreen > 1) return;
+
+ try {
+ // Soll-Zustaende
+ var close_switch = aios_gPrefBranch.getBoolPref('fs.switch');
+ var close_toolbar = aios_gPrefBranch.getBoolPref('fs.toolbar');
+ var close_sidebar = aios_gPrefBranch.getBoolPref('fs.sidebar');
+
+ // Ist-Zustaende
+ var rem_switchHidden = aios_getBoolean(aios_toggleBox, 'hidden');
+ var rem_toolbarHidden = aios_getBoolean(aios_toolbar, 'hidden');
+ var rem_sidebarHidden = aios_isSidebarHidden();
+ }
+ catch(e) {
+ return false;
+ }
// Ist-Zustaende speichern
aios_toggleBox.setAttribute('fsSwitch', rem_switchHidden);
@@ -777,6 +788,12 @@ function aios_BrowserFullScreen() {
// Fullscreen aus
// => Elemente einblenden
else {
+
+ // Fix für mehrmaliges feuern des mozfullscreenchange events
+ aios_enterFullScreen = 0;
+ aios_leaveFullScreen++;
+ if(aios_leaveFullScreen > 1) return;
+
// Toolbareinstellungen wiederherstellen (nur ohne die Erweiterung Autohide)
if(typeof autoHIDE != "object") {
aios_toolbar.setAttribute("mode", aios_toggleBox.getAttribute('fsToolbarMode'));
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/all-in-one-sidebar.git
More information about the Pkg-mozext-commits
mailing list