Bug 627851 - PreferencesView._delayedInit is not delayed enough [r=mfinkle]

This commit is contained in:
Matt Brubeck 2011-01-27 09:36:22 -08:00
parent 798a667255
commit b5120ebfb6
2 changed files with 11 additions and 3 deletions

View File

@ -743,8 +743,14 @@ var BrowserUI = {
Elements.panelUI.hidden = false;
Elements.contentShowing.setAttribute("disabled", "true");
if (aPage != undefined)
if (aPage) {
this.switchPane(aPage);
} else {
// Fire a "select" event anyway so listeners know when the panel is opened.
let event = document.createEvent("Events");
event.initEvent("select", true, true);
document.getElementById("panel-items").dispatchEvent(event);
}
},
hidePanel: function hidePanel() {

View File

@ -41,7 +41,7 @@ var PreferencesView = {
_msg: null,
_restartCount: 0,
_messageActions: function ev__messageActions(aData) {
_messageActions: function pv__messageActions(aData) {
if (aData == "prefs-restart-app") {
// Notify all windows that an application quit has been requested
var cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
@ -107,13 +107,15 @@ var PreferencesView = {
let panels = document.getElementById("panel-items");
panels.addEventListener("select",
function(aEvent) {
if (aEvent.target != panels)
return;
if (panels.selectedPanel.id == "prefs-container")
self._delayedInit();
},
false);
},
_delayedInit: function ev__delayedInit() {
_delayedInit: function pv__delayedInit() {
if (this._languages)
return;