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

Unified Diff: issue-reporter.js

Issue 29587613: Issue 5917 - Improve display of report data in the issue reporter (Closed) Base URL: https://hg.adblockplus.org/adblockplusui/
Patch Set: Created Oct. 24, 2017, 11:55 a.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
Index: issue-reporter.js
===================================================================
--- a/issue-reporter.js
+++ b/issue-reporter.js
@@ -294,29 +294,52 @@ function initCommentPage()
let value = event.target.value.trim();
commentElement.textContent = value.substr(0, 1000);
if (value)
reportData.documentElement.appendChild(commentElement);
document.getElementById("commentLengthWarning")
.setAttribute("data-invisible", value.length <= 1000);
});
+ let showDataOverlay = document.getElementById("showDataOverlay");
document.getElementById("showData").addEventListener("click", event =>
{
event.preventDefault();
- // window.open() won't open data: URIs in Chrome
- browser.tabs.getCurrent().then(tab =>
+ showDataOverlay.hidden = false;
+
+ let element = document.getElementById("showDataValue");
+ element.value = serializeReportData();
+ element.focus();
+ });
+
+ document.getElementById("showDataClose").addEventListener("click", event =>
+ {
+ showDataOverlay.hidden = true;
+ document.getElementById("showData").focus();
+ });
+
+ showDataOverlay.addEventListener("keydown", event =>
+ {
+ if (event.key == "Enter" || event.key == "Escape")
{
- browser.tabs.create({
- url: "data:text/xml;charset=utf-8," +
- encodeURIComponent(serializeReportData()),
- openerTabId: tab.id
- });
Wladimir Palant 2017/10/24 11:58:29 It would have been possible to merely fix this cal
kzar 2017/10/24 13:39:57 Acknowledged.
- });
+ // Stop propagation to prevent higher level event handler from processing
+ // this event.
+ event.stopPropagation();
+ document.getElementById("showDataClose").click();
+ }
+ });
+
+ showDataOverlay.addEventListener("click", event =>
+ {
+ if (event.eventPhase == event.AT_TARGET)
+ {
+ // User clicked outside overlay content
+ document.getElementById("showDataClose").click();
+ }
});
emailField.focus();
}
function leaveCommentPage()
{
setCurrentPage("sendPage");
« issue-reporter.html ('K') | « issue-reporter.html ('k') | skin/issue-reporter.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld