Bug with table headers and vertical scroll bar (plunker + potential fix)
Bug with table headers and vertical scroll bar (plunker + potential fix)
Hi All(an),
Noticed an issue with the datatables header getting a bit messed up as is demonstrated in this plunker:
http://plnkr.co/edit/96eAeq2F17gckRxydEFN?p=preview
In this particular example (and in the website I'm developing) we have css code that directly trims the size of the body like so:
@media (max-width: 800px) {
body {
/.../
max-width: 90%;
/.../
}
In the datatables method _fnBrowserDetect() we have the following line:
browser.bScrollbarLeft = test.offset().left !== 1;
Problem is when the body is trimmed, as in this example, the offset is something other than 1. For me it was something like 42.xx in my debugging. I've made the following alteration in my code which fixed it for me for most browsers, but I imagine it has to pass a more rigorous set of tests to make it into DT anyways:
if (test.parent()) {
browser.bScrollbarLeft = test.parent().offset() / test.offset().left > 1;
} else {
browser.bScrollbarLeft = test.offset().left !== 1;
}
Let me know your thoughts...
-Keith
Replies
That should be:
Thanks Keith,
I found that this fixes when you have a paged zoomed at a ratio other than 100% in chrome
Nice... totally had no idea it would do that, but that's great.