[BUGFIX] Hide statistic onclick header

This commit is contained in:
Xaver Maierhofer 2017-02-19 00:15:36 +01:00
parent 57e06a0c59
commit ec3cce9173
No known key found for this signature in database
GPG Key ID: 7FDCE23FD2EC9FE8
2 changed files with 15 additions and 25 deletions

View File

@ -8,21 +8,11 @@ define(['chroma-js', 'virtual-dom', 'filters/genericnode', 'helper'],
var statusTable = document.createElement('table');
statusTable.classList.add('proportion');
var fwTable = document.createElement('table');
fwTable.classList.add('proportion');
var hwTable = document.createElement('table');
hwTable.classList.add('proportion');
var geoTable = document.createElement('table');
geoTable.classList.add('proportion');
var autoTable = document.createElement('table');
autoTable.classList.add('proportion');
var siteTable = document.createElement('table');
siteTable.classList.add('proportion');
var fwTable = statusTable.cloneNode(false);
var hwTable = statusTable.cloneNode(false);
var geoTable = statusTable.cloneNode(false);
var autoTable = statusTable.cloneNode(false);
var siteTable = statusTable.cloneNode(false);
function showStatGlobal(o) {
return helper.showStat(o);
@ -53,7 +43,6 @@ define(['chroma-js', 'virtual-dom', 'filters/genericnode', 'helper'],
function addFilter(filter) {
return function () {
filterManager.addFilter(filter);
return false;
};
}
@ -63,12 +52,9 @@ define(['chroma-js', 'virtual-dom', 'filters/genericnode', 'helper'],
table.last = V.h('table');
}
var max = 0;
data.forEach(function (d) {
if (d[1] > max) {
max = d[1];
}
});
var max = Math.max.apply(Math, data.map(function (o) {
return o[1];
}));
var items = data.map(function (d) {
var v = d[1] / max;
@ -181,11 +167,11 @@ define(['chroma-js', 'virtual-dom', 'filters/genericnode', 'helper'],
};
self.renderSingle = function renderSingle(el, heading, table) {
var h2;
h2 = document.createElement('h2');
var h2 = document.createElement('h2');
h2.classList.add('proportion-header');
h2.textContent = _.t(heading);
h2.onclick = function onclick() {
table.classList.toggle('hidden');
table.classList.toggle('hide');
};
el.appendChild(h2);
el.appendChild(table);

View File

@ -1,3 +1,7 @@
.proportion-header {
cursor: pointer;
}
.proportion {
th {
font-size: .95em;