[Pkg-mozext-commits] [tabmixplus] 06/15: CustomizableUI.getWidgetIdsInArea throw if called too early. Using Walnut theme on Linux Ubuntu throw onWindowOpen
David Prévot
taffit at moszumanska.debian.org
Wed Mar 18 19:05:18 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository tabmixplus.
commit 1500a76587070c4475213d4137261e4051c4fbe5
Author: onemen <tabmix.onemen at gmail.com>
Date: Mon Mar 9 19:44:54 2015 +0200
CustomizableUI.getWidgetIdsInArea throw if called too early. Using Walnut theme on Linux Ubuntu throw onWindowOpen
---
chrome/content/minit/minit.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/chrome/content/minit/minit.js b/chrome/content/minit/minit.js
index c9f7441..916b802 100644
--- a/chrome/content/minit/minit.js
+++ b/chrome/content/minit/minit.js
@@ -1298,7 +1298,9 @@ Tabmix.navToolbox = {
* restore tabmix-tabs-closebutton and new-tab-button position.
*/
this.setScrollButtons();
- this.setCloseButtonPosition();
+ try {
+ this.setCloseButtonPosition();
+ } catch(ex) { }
gTMPprefObserver.changeNewTabButtonSide(Tabmix.prefs.getIntPref("newTabButton.position"));
this.setScrollButtons(false, true);
@@ -1338,7 +1340,6 @@ Tabmix.navToolbox = {
setCloseButtonPosition: function() {
if (this._closeButtonInitialized)
return;
- this._closeButtonInitialized = true;
if (!Tabmix.isVersion(310))
return;
@@ -1353,6 +1354,7 @@ Tabmix.navToolbox = {
// try to restore button position from tabs-closebutton position
// if item with tabs-closebutton id exist, some other extension add it
else if (!document.getElementById("tabs-closebutton")) {
+ // will throw if called too early (before placements have been fetched)
let currentset = CustomizableUI.getWidgetIdsInArea("TabsToolbar");
let position = currentset.indexOf("tabs-closebutton");
if (position > -1) {
@@ -1360,6 +1362,7 @@ Tabmix.navToolbox = {
CustomizableUI.moveWidgetWithinArea("tabmix-tabs-closebutton", position);
}
}
+ this._closeButtonInitialized = true;
}
};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git
More information about the Pkg-mozext-commits
mailing list