Bug 609661 - Fire ViewChanged event when adding items to addon manager [r=mfinkle]

This commit is contained in:
Wes Johnston 2010-11-04 16:18:00 -04:00
parent b9248c561d
commit db77afc225
2 changed files with 14 additions and 7 deletions

View File

@ -577,6 +577,10 @@ var ExtensionsView = {
showmore.setAttribute("url", browseURL);
this._list.appendChild(showmore);
let evt = document.createEvent("Events");
evt.initEvent("ViewChanged", true, false);
this._list.dispatchEvent(evt);
},
displaySearchResults: function ev_displaySearchResults(aAddons, aTotalResults, aSelectFirstResult) {

View File

@ -165,15 +165,18 @@ function open_manager(aView, aCallback) {
panelButton.click();
var addonsButton = document.getElementById("tool-addons");
addonsButton.click();
ExtensionsView.init();
ExtensionsView._delayedInit();
// XXX - give the list time to add addons from the repo
// find a better way to do this
setTimeout(function() {
if (!ExtensionsView._list) {
window.addEventListener("ViewChanged", function() {
window.removeEventListener("ViewChanged", arguments.callee, true);
aCallback();
}, true);
ExtensionsView.init();
ExtensionsView._delayedInit();
} else {
aCallback();
}, 2000);
}
}
function close_manager(aCallback) {