Prevent overloading of window.onload
This commit is contained in:
		
							parent
							
								
									24c4972c44
								
							
						
					
					
						commit
						051555ef14
					
				| 
						 | 
				
			
			@ -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();
 | 
			
		||||
}
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
window.onload = () => {
 | 
			
		||||
window.addEventListener('load', () => {
 | 
			
		||||
    document.getElementById('upload-button').addEventListener('click', () => {
 | 
			
		||||
        document.getElementById('file-input').click();
 | 
			
		||||
    });
 | 
			
		||||
| 
						 | 
				
			
			@ -14,4 +14,4 @@ window.onload = () => {
 | 
			
		|||
        "info": false,
 | 
			
		||||
        "dom": "t",
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
window.onload = () => {
 | 
			
		||||
window.addEventListener('load', () => {
 | 
			
		||||
    const timeElement = document.getElementById('creation-time');
 | 
			
		||||
    const creationTime = timeElement.getAttribute('data-creation-time');
 | 
			
		||||
    const creationDate = new Date(creationTime);
 | 
			
		||||
    timeElement.innerText = creationDate.toLocaleString();
 | 
			
		||||
};
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue