Issue reporter sys info/extensions drop down UX issues, #42564

This commit is contained in:
Rachel Macfarlane
2018-02-06 17:01:01 -08:00
parent b54b329625
commit 153ffd21e6
3 changed files with 28 additions and 12 deletions

View File

@@ -245,6 +245,24 @@ export class IssueReporter extends Disposable {
});
});
const labelElements = document.getElementsByClassName('caption');
for (let i = 0; i < labelElements.length; i++) {
const label = labelElements.item(i);
label.addEventListener('click', (e) => {
e.stopPropagation();
// Stop propgagation not working as expected in this case https://bugs.chromium.org/p/chromium/issues/detail?id=809801
// preventDefault does prevent outer details tag from toggling, so use that and manually toggle the checkbox
e.preventDefault();
const containingDiv = (<HTMLLabelElement>e.target).parentElement;
const checkbox = <HTMLInputElement>containingDiv.firstElementChild;
if (checkbox) {
checkbox.checked = !checkbox.checked;
this.issueReporterModel.update({ [checkbox.id]: !this.issueReporterModel.getData()[checkbox.id] });
}
});
}
document.getElementById('reproducesWithoutExtensions').addEventListener('click', (e) => {
this.issueReporterModel.update({ reprosWithoutExtensions: true });
});