summaryrefslogtreecommitdiffstats
path: root/browser/base/content
diff options
context:
space:
mode:
authorNew Tobin Paradigm <email@mattatobin.com>2018-04-12 17:40:27 -0400
committerGitHub <noreply@github.com>2018-04-12 17:40:27 -0400
commite226e36a6c1792b68ba22a2ae43b8e1e230b5246 (patch)
tree06a4de51ce6c676b27bacbd4f33ce524d40f3838 /browser/base/content
parent47354a0f29913df58a6c50fa8b34b1e817a368af (diff)
parentc06b8691e3cc33682fe2b8b614ec36ce0aada079 (diff)
downloadUXP-e226e36a6c1792b68ba22a2ae43b8e1e230b5246.tar
UXP-e226e36a6c1792b68ba22a2ae43b8e1e230b5246.tar.gz
UXP-e226e36a6c1792b68ba22a2ae43b8e1e230b5246.tar.lz
UXP-e226e36a6c1792b68ba22a2ae43b8e1e230b5246.tar.xz
UXP-e226e36a6c1792b68ba22a2ae43b8e1e230b5246.zip
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/content')
-rw-r--r--browser/base/content/browser-places.js33
1 files changed, 16 insertions, 17 deletions
diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js
index a447880be..83c737977 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);
}),