[TASK] Hide stats title when table is empty

This commit is contained in:
Moritz Warning 2017-09-02 23:55:00 +02:00 committed by Xaver Maierhofer
parent c24cf3cfb5
commit 779fa0a630
No known key found for this signature in database
GPG Key ID: 7FDCE23FD2EC9FE8

View File

@ -178,14 +178,16 @@ define(['d3-interpolate', 'snabbdom', 'filters/genericnode', 'helper'],
}; };
self.renderSingle = function renderSingle(el, heading, table) { self.renderSingle = function renderSingle(el, heading, table) {
var h2 = document.createElement('h2'); if (table.children.length > 0) {
h2.classList.add('proportion-header'); var h2 = document.createElement('h2');
h2.textContent = _.t(heading); h2.classList.add('proportion-header');
h2.onclick = function onclick() { h2.textContent = _.t(heading);
table.elm.classList.toggle('hide'); h2.onclick = function onclick() {
}; table.elm.classList.toggle('hide');
el.appendChild(h2); };
el.appendChild(table.elm); el.appendChild(h2);
el.appendChild(table.elm);
}
}; };
return self; return self;
}; };