Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/inspectorObserver.js

Issue 29322778: Issue 2816 - Partial fix for EHH button in inspector tool, preview functionality still broken (Closed)
Patch Set: Preemptively fixed some nits and compatibility info Created July 29, 2015, 12:41 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/aardvark.js ('k') | lib/main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/inspectorObserver.js
===================================================================
--- a/lib/inspectorObserver.js
+++ b/lib/inspectorObserver.js
@@ -44,20 +44,36 @@ let InspectorObserver =
return;
let tooltiptext = InspectorObserver.inspectorButtonTooltip;
button = panelWindow.document.createElement("toolbarbutton");
button.setAttribute("id", "ehh-inspector-toolbarbutton");
button.setAttribute("class", "devtools-toolbarbutton");
button.setAttribute("tooltiptext", tooltiptext);
button.setAttribute("tabindex", "0");
- button.addEventListener("command", function()
+ button.addEventListener("command", () =>
{
- panelWindow.openDialog("chrome://elemhidehelper/content/composer.xul", "_blank",
- "chrome,centerscreen,resizable,dialog=no", panel.selection.node);
+ let node = panel.selection.nodeFront;
+ let target = panel.target;
+ if (node && target.form.elemhidehelper)
+ {
+ target.client.request({
+ to: target.form.elemhidehelper,
+ type: "nodeinfo",
+ nodeActor: node.actorID
+ }, function(response)
+ {
+ if (!response.nodeData)
+ return;
+
+ panelWindow.openDialog("chrome://elemhidehelper/content/composer.xul",
+ "_blank", "chrome,centerscreen,resizable,dialog=no",
+ response.nodeData, response.host);
+ });
+ }
}, false);
//Override button style for light DevTools theme
let style = panelWindow.document.createProcessingInstruction("xml-stylesheet", 'href="chrome://elemhidehelper/skin/devToolsOverlay.css" type="text/css"');
panelWindow.document.insertBefore(style, panelWindow.document.firstChild);
inspectBtn.parentNode.insertBefore(button, inspectBtn);
}
« no previous file with comments | « lib/aardvark.js ('k') | lib/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld