Prevent overloading of window.onload

This commit is contained in:
Chris Wilson
2020-07-23 20:54:25 -04:00
parent 24c4972c44
commit 051555ef14
3 changed files with 7 additions and 11 deletions

View File

@@ -1,7 +1,5 @@
let tables = null;
window.onload = () => {
tables = $(".table").DataTable({
window.addEventListener('load', () => {
const tables = $(".table").DataTable({
paging: false,
info: false,
scrollCollapse: true,
@@ -37,6 +35,4 @@ window.onload = () => {
y_sync: true,
x_sync: true
});
window.onresize = () => tables.draw();
}
});