From e3558a911fed681eeffe1a1e9a543145d83b1096 Mon Sep 17 00:00:00 2001 From: Carsten Grohmann Date: Mon, 16 Apr 2018 21:06:20 +0200 Subject: [PATCH] Hide table rows w/o values instead of showing "" --- OOMAnalyser.html | 4 ++-- OOMAnalyser.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/OOMAnalyser.html b/OOMAnalyser.html index c7a8977..9f546bb 100644 --- a/OOMAnalyser.html +++ b/OOMAnalyser.html @@ -30,8 +30,8 @@ content: " pages"; } - .notfound { - text-align: right; + .hide_tablerow { + display: none; } table { diff --git a/OOMAnalyser.py b/OOMAnalyser.py index fd148d8..6bd3f87 100644 --- a/OOMAnalyser.py +++ b/OOMAnalyser.py @@ -464,8 +464,8 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k element.textContent = content if content == '': - element.classList.remove('kbytes', 'pages') - element.classList.add('notfound') + row = element.parentNode + row.classList.add('hide_tablerow') elif item.endswith('_kb'): element.classList.add('kbytes') elif item.endswith('_pages'): @@ -485,6 +485,10 @@ Killed process 6576 (java) total-vm:33914892kB, anon-rss:20629004kB, file-rss:0k hide_element("notify_box") show_element("input") + # show hidden rows + for element in document.getElementsByClassName('hide_tablerow'): + element.classList.remove('hide_tablerow') + self.lines = [] self.details = {} for item in self.mem_modinfo_entries: