[Pkg-mozext-commits] [firetray] 21/33: Remove mail/chat prefpanes in non-mail apps instead of hiding them.
David Prévot
taffit at moszumanska.debian.org
Fri Oct 23 21:35:11 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository firetray.
commit 86f161e2f96f9fa5155652849db3e61268777d1f
Author: foudfou <foudil.newbie+git at gmail.com>
Date: Mon Sep 7 21:58:14 2015 +0200
Remove mail/chat prefpanes in non-mail apps instead of hiding them.
This truely auto-resizes the pref window at the cost of some warnings.
---
src/chrome/content/options.js | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/src/chrome/content/options.js b/src/chrome/content/options.js
index 9d8e8c3..95bd573 100644
--- a/src/chrome/content/options.js
+++ b/src/chrome/content/options.js
@@ -34,7 +34,7 @@ var firetrayUIOptions = {
Cu.import("resource://firetray/FiretrayMessaging.jsm");
this.initMailControls();
} else {
- this.hidePrefPane("pref-pane-mail");
+ this.removePrefPane("pref-pane-mail");
}
if (firetray.Handler.isChatProvided() &&
@@ -43,7 +43,7 @@ var firetrayUIOptions = {
Cu.import("resource://firetray/"+firetray.Handler.app.OS+"/FiretrayChat.jsm");
this.initChatControls();
} else {
- this.hidePrefPane("pref-pane-chat");
+ this.removePrefPane("pref-pane-chat");
};
this.updateWindowAndIconOptions();
@@ -107,14 +107,20 @@ var firetrayUIOptions = {
};
});
-
},
- hidePrefPane: function(name){
+ // addPane would probably be smarter but is hardly achievable (loadOverlay?).
+ removePrefPane: function(name){
+ // FIXME: uncatchable exception "this.preferences.rootBranchInternal is
+ // undefined". See toolkit/content/widgets/preferences.xml during
+ // <preference> destruction. Deleting each preference beforehand doesn't
+ // help.
+
+ let pane = document.getElementById(name);
+ pane.parentNode.removeChild(pane);
+
let radio = document.getAnonymousElementByAttribute(this.prefwindow, "pane", name);
- if (radio.selected)
- this.prefwindow.showPane(document.getElementById(PREF_DEFAULT_PANE));
- radio.hidden = true;
+ radio.parentNode.removeChild(radio);
},
hideChildren: function(group, hiddenval) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firetray.git
More information about the Pkg-mozext-commits
mailing list