Bug 1392403 - Ease the dismiss of the popup in about:telemetry r=chutten

Fix ping selector popup is sometimes hard to dismiss.

MozReview-Commit-ID: KEFcmq6cvRA

--HG--
extra : rebase_source : e2a6b13bd7f355aa88e47c50347d03aee5f0fa57
This commit is contained in:
flyingrub 2017-08-23 16:40:12 +02:00
Родитель 21ef26ac40
Коммит 216e775829
1 изменённых файлов: 16 добавлений и 6 удалений

Просмотреть файл

@ -321,19 +321,29 @@ var PingPicker = {
document.getElementById("older-ping")
.addEventListener("click", () => this._movePingIndex(1));
let pingPickerNeedHide = false;
let pingPicker = document.getElementById("ping-picker");
pingPicker.addEventListener("mouseenter", () => pingPickerNeedHide = false);
pingPicker.addEventListener("mouseleave", () => pingPickerNeedHide = true);
document.addEventListener("click", (ev) => {
if (ev.target.querySelector("#ping-picker")) {
document.getElementById("ping-picker").classList.add("hidden");
if (pingPickerNeedHide) {
pingPicker.classList.add("hidden");
}
});
document.getElementById("choose-payload")
.addEventListener("change", () => displayPingData(gPingData));
document.getElementById("processes")
.addEventListener("change", () => displayPingData(gPingData));
Array.from(document.querySelectorAll(".change-ping")).forEach(el =>
el.addEventListener("click", () =>
document.getElementById("ping-picker").classList.remove("hidden"))
);
Array.from(document.querySelectorAll(".change-ping")).forEach(el => {
el.addEventListener("click", (event) => {
if (!pingPicker.classList.contains("hidden")) {
pingPicker.classList.add("hidden");
} else {
pingPicker.classList.remove("hidden")
event.stopPropagation();
}
});
});
},
onPingSourceChanged() {