fix for Firefox: hide empty tbody - jscancer - Javascript crap (relatively small)
(HTM) git clone git://git.codemadness.org/jscancer
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 9b8f9db8eb2c2a9a299ac2cf943453f2d198cbf5
(DIR) parent 2932500f1d5f978262bb31afde0ea85543f641ce
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Thu, 3 Aug 2017 19:00:03 +0200
fix for Firefox: hide empty tbody
when a tfoot is used, but the tbody has no visible elements then the
table rendering was weird in Firefox.
Diffstat:
M datatable/datatable.js | 3 +++
1 file changed, 3 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/datatable/datatable.js b/datatable/datatable.js
@@ -107,6 +107,8 @@ function datatable_init(el) {
for (var i = start, prev = startfiller, p = bodytbody; i <= end; i++)
prev = p.insertBefore(d.data[i].tr, prev.nextSibling);
+
+ tbody.hidden = !nrows;
};
d.scroll = function(y) {
bodyel.scrollTop = y;
@@ -133,6 +135,7 @@ function datatable_init(el) {
for (var i = 0; i < data.length; i++)
tbody.appendChild(data[i].tr);
d.table.replaceChild(tbody, d.tbody);
+ tbody.hidden = !data.length;
d.tbody = tbody;
};
}