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

Side by Side Diff: lib/inspectorObserver.js

Issue 29322778: Issue 2816 - Partial fix for EHH button in inspector tool, preview functionality still broken (Closed)
Patch Set: Unified code paths Created July 29, 2015, 12:23 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/aardvark.js ('k') | lib/main.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This Source Code is subject to the terms of the Mozilla Public License 2 * This Source Code is subject to the terms of the Mozilla Public License
3 * version 2.0 (the "License"). You can obtain a copy of the License at 3 * version 2.0 (the "License"). You can obtain a copy of the License at
4 * http://mozilla.org/MPL/2.0/. 4 * http://mozilla.org/MPL/2.0/.
5 */ 5 */
6 6
7 let InspectorObserver = 7 let InspectorObserver =
8 { 8 {
9 init: function() 9 init: function()
10 { 10 {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 let inspectBtn = panelWindow.document.getElementById("inspector-breadcrumbs" ); 42 let inspectBtn = panelWindow.document.getElementById("inspector-breadcrumbs" );
43 if (!inspectBtn) 43 if (!inspectBtn)
44 return; 44 return;
45 45
46 let tooltiptext = InspectorObserver.inspectorButtonTooltip; 46 let tooltiptext = InspectorObserver.inspectorButtonTooltip;
47 button = panelWindow.document.createElement("toolbarbutton"); 47 button = panelWindow.document.createElement("toolbarbutton");
48 button.setAttribute("id", "ehh-inspector-toolbarbutton"); 48 button.setAttribute("id", "ehh-inspector-toolbarbutton");
49 button.setAttribute("class", "devtools-toolbarbutton"); 49 button.setAttribute("class", "devtools-toolbarbutton");
50 button.setAttribute("tooltiptext", tooltiptext); 50 button.setAttribute("tooltiptext", tooltiptext);
51 button.setAttribute("tabindex", "0"); 51 button.setAttribute("tabindex", "0");
52 button.addEventListener("command", function() 52 button.addEventListener("command", () =>
53 { 53 {
54 panelWindow.openDialog("chrome://elemhidehelper/content/composer.xul", "_b lank", 54 let node = panel.selection.nodeFront;
55 "chrome,centerscreen,resizable,dialog=no", panel.se lection.node); 55 if (panel.target.form.elemhidehelper)
56 {
57 panel.target.client.request({to: panel.target.form.elemhidehelper, type: "nodeinfo", nodeActor: node.actorID}, function(response)
58 {
59 if ("nodeData" in response)
60 {
61 panelWindow.openDialog("chrome://elemhidehelper/content/composer.xul ", "_blank",
62 "chrome,centerscreen,resizable,dialog=no", re sponse.nodeData, response.host);
63 }
64 });
65 }
56 }, false); 66 }, false);
57 67
58 //Override button style for light DevTools theme 68 //Override button style for light DevTools theme
59 let style = panelWindow.document.createProcessingInstruction("xml-stylesheet ", 'href="chrome://elemhidehelper/skin/devToolsOverlay.css" type="text/css"'); 69 let style = panelWindow.document.createProcessingInstruction("xml-stylesheet ", 'href="chrome://elemhidehelper/skin/devToolsOverlay.css" type="text/css"');
60 panelWindow.document.insertBefore(style, panelWindow.document.firstChild); 70 panelWindow.document.insertBefore(style, panelWindow.document.firstChild);
61 71
62 inspectBtn.parentNode.insertBefore(button, inspectBtn); 72 inspectBtn.parentNode.insertBefore(button, inspectBtn);
63 } 73 }
64 }; 74 };
65 75
66 InspectorObserver.init(); 76 InspectorObserver.init();
OLDNEW
« 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