Bug 1389030 - Go to home when section has no data in about:telemetry r=chutten

When switching to a ping that hasn't data for the current section go to
home section.

MozReview-Commit-ID: 2zTZUiyHe0M

--HG--
extra : rebase_source : 2abe235c99cf2b0b6579c9fbac940b5bc8a0a532
This commit is contained in:
flyingrub 2017-08-10 18:45:19 +02:00
parent c0706372d9
commit dad19047d2

View File

@ -1899,6 +1899,13 @@ function adjustSearchState() {
}
}
function adjustSection() {
let selectedCategory = document.querySelector(".category.selected");
if (!selectedCategory.classList.contains("has-data")) {
PingPicker._showStructuredPingData();
}
}
/**
* Change the url according to the current section displayed
* e.g about:telemetry#general-data
@ -2360,11 +2367,12 @@ function displayPingData(ping, updatePayloadList = false) {
try {
PingPicker.render();
displayRichPingData(ping, updatePayloadList);
adjustSearchState();
adjustSection();
} catch (err) {
console.log(err);
PingPicker._showRawPingData();
}
adjustSearchState();
}
function displayRichPingData(ping, updatePayloadList) {