diff options
author | New Tobin Paradigm <email@mattatobin.com> | 2018-04-12 17:40:27 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-12 17:40:27 -0400 |
commit | e226e36a6c1792b68ba22a2ae43b8e1e230b5246 (patch) | |
tree | 06a4de51ce6c676b27bacbd4f33ce524d40f3838 /browser/base | |
parent | 47354a0f29913df58a6c50fa8b34b1e817a368af (diff) | |
parent | c06b8691e3cc33682fe2b8b614ec36ce0aada079 (diff) | |
download | uxp-e226e36a6c1792b68ba22a2ae43b8e1e230b5246.tar.gz |
Merge pull request #134 from janekptacijarabaci/places_error_1
Places - fix: throws an error: 0x80004005 (NS_ERROR_FAILURE) [nsIEditor.transactionManager]
Diffstat (limited to 'browser/base')
-rw-r--r-- | browser/base/content/browser-places.js | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index a447880be3..83c7379775 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -299,24 +299,23 @@ var StarUI = { parent.setAttribute("open", "true"); } } - let panel = this.panel; - let target = 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 shownListener(event) { - if (event.target == panel) { - target.removeEventListener("popupshown", shownListener, true); - - gEditItemOverlay.initPanel({ node: aNode - , hiddenRows: ["description", "location", - "loadInSidebar", "keyword"] - , focusedElement: "preferred"}); + 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; } - }, true); + target.addEventListener("popupshown", function(event) { + fn(); + }, {"capture": true, "once": true}); + }; + gEditItemOverlay.initPanel({ node: aNode + , onPanelReady + , hiddenRows: ["description", "location", + "loadInSidebar", "keyword"] + , focusedElement: "preferred"}); this.panel.openPopup(aAnchorElement, aPosition); }), |