Bug 1171382 - Add logic to not render empty keyed histograms. r=gfritzsche

This commit is contained in:
rthyberg 2015-08-26 12:57:00 -04:00
Родитель 0ae8f7d2dd
Коммит aa9e778c8e
1 изменённых файлов: 8 добавлений и 5 удалений

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

@ -1593,14 +1593,17 @@ function displayPingData(ping) {
let keyedDiv = document.getElementById("keyed-histograms");
removeAllChildNodes(keyedDiv);
setHasData("keyed-histograms-section", false);
let keyedHistograms = payload.keyedHistograms;
hasData = Object.keys(keyedHistograms).length > 0;
setHasData("keyed-histograms-section", hasData);
if (hasData) {
if (keyedHistograms) {
let hasData = false;
for (let [id, keyed] of Iterator(keyedHistograms)) {
KeyedHistogram.render(keyedDiv, id, keyed, {unpacked: true});
if (Object.keys(keyed).length > 0) {
hasData = true;
KeyedHistogram.render(keyedDiv, id, keyed, {unpacked: true});
}
}
setHasData("keyed-histograms-section", hasData);
}
// Show addon histogram data