From 37bd28f3efb0a3faf2b771f00626dabc7c29901d Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 18 Apr 2018 18:59:02 +0200 Subject: [PALEMOON] Places - fix: throws an error: 0x80004005 (NS_ERROR_FAILURE) [nsIEditor.transactionManager] Issue #133 Tag https://github.com/MoonchildProductions/UXP/pull/134 --- application/palemoon/base/content/browser-places.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'application/palemoon/base/content/browser-places.js') diff --git a/application/palemoon/base/content/browser-places.js b/application/palemoon/base/content/browser-places.js index 5c13a43f9..590fe7ecd 100644 --- a/application/palemoon/base/content/browser-places.js +++ b/application/palemoon/base/content/browser-places.js @@ -189,11 +189,24 @@ var StarUI = { this._itemId = aItemId !== undefined ? aItemId : this._itemId; this.beginBatch(); - this.panel.openPopup(aAnchorElement, aPosition); - + let onPanelReady = fn => { + let target = this.panel; + if (target.parentNode) { + // By targeting the panel's parent and using a capturing listener, we + // can have our listener called before others waiting for the panel to + // be shown (which probably expect the panel to be fully initialized) + target = target.parentNode; + } + target.addEventListener("popupshown", function(event) { + fn(); + }, {"capture": true, "once": true}); + }; gEditItemOverlay.initPanel(this._itemId, - { hiddenRows: ["description", "location", + { onPanelReady, + hiddenRows: ["description", "location", "loadInSidebar", "keyword"] }); + + this.panel.openPopup(aAnchorElement, aPosition); }, panelShown: -- cgit v1.2.3