mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 633196 - Object details don't open in the Web Console, when trying a second time; f=rcampbell r=dolske approval2.0=dolske
This commit is contained in:
parent
455787745c
commit
4c111113d2
@ -4071,10 +4071,9 @@ JSTerm.prototype = {
|
||||
{
|
||||
let self = this;
|
||||
let propPanel;
|
||||
// The property panel has two buttons:
|
||||
// 1. `Update`: reexecutes the string executed on the command line. The
|
||||
// The property panel has one button:
|
||||
// `Update`: reexecutes the string executed on the command line. The
|
||||
// result will be inspected by this panel.
|
||||
// 2. `Close`: destroys the panel.
|
||||
let buttons = [];
|
||||
|
||||
// If there is a evalString passed to this function, then add a `Update`
|
||||
@ -4102,22 +4101,14 @@ JSTerm.prototype = {
|
||||
});
|
||||
}
|
||||
|
||||
buttons.push({
|
||||
label: HUDService.getStr("close.button"),
|
||||
accesskey: HUDService.getStr("close.accesskey"),
|
||||
class: "jsPropertyPanelCloseButton",
|
||||
oncommand: function () {
|
||||
propPanel.destroy();
|
||||
aAnchor._panelOpen = false;
|
||||
}
|
||||
});
|
||||
|
||||
let doc = self.parentNode.ownerDocument;
|
||||
let parent = doc.getElementById("mainPopupSet");
|
||||
let title = (aEvalString
|
||||
? HUDService.getFormatStr("jsPropertyInspectTitle", [aEvalString])
|
||||
: HUDService.getStr("jsPropertyTitle"));
|
||||
|
||||
propPanel = new PropertyPanel(parent, doc, title, aOutputObject, buttons);
|
||||
propPanel.linkNode = aAnchor;
|
||||
|
||||
let panel = propPanel.panel;
|
||||
panel.openPopup(aAnchor, "after_pointer", 0, 0, false, false);
|
||||
|
@ -430,7 +430,8 @@ function PropertyPanel(aParent, aDocument, aTitle, aObject, aButtons)
|
||||
label: aTitle,
|
||||
titlebar: "normal",
|
||||
noautofocus: "true",
|
||||
noautohide: "true"
|
||||
noautohide: "true",
|
||||
close: "true",
|
||||
});
|
||||
|
||||
// Create the tree.
|
||||
@ -484,6 +485,12 @@ function PropertyPanel(aParent, aDocument, aTitle, aObject, aButtons)
|
||||
self.panel.removeEventListener("popupshown", onPopupShow, false);
|
||||
self.tree.view = self.treeView;
|
||||
}, false);
|
||||
|
||||
this.panel.addEventListener("popuphidden", function onPopupHide()
|
||||
{
|
||||
self.panel.removeEventListener("popuphidden", onPopupHide, false);
|
||||
self.destroy();
|
||||
}, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -494,9 +501,13 @@ function PropertyPanel(aParent, aDocument, aTitle, aObject, aButtons)
|
||||
*/
|
||||
PropertyPanel.prototype.destroy = function PP_destroy()
|
||||
{
|
||||
this.panel.hidePopup();
|
||||
this.panel.parentNode.removeChild(this.panel);
|
||||
this.treeView = null;
|
||||
this.panel = null;
|
||||
this.tree = null;
|
||||
|
||||
if (this.linkNode) {
|
||||
this.linkNode._panelOpen = false;
|
||||
this.linkNode = null;
|
||||
}
|
||||
}
|
||||
|
@ -117,8 +117,7 @@ function properyPanelShown(aEvent) {
|
||||
|
||||
executeSoon(function() {
|
||||
aEvent.target.addEventListener("popuphidden", propertyPanelHidden, false);
|
||||
let closeButton = aEvent.target.querySelector(".jsPropertyPanelCloseButton");
|
||||
closeButton.doCommand();
|
||||
aEvent.target.hidePopup();
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user