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

View File

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