User:Dimpizzy/common.js: Difference between revisions

From Comprehensible Input Wiki
Content deleted Content added
Blanked the page
Tags: Blanking Manual revert
No edit summary
Line 1: Line 1:
$(document).ready( function () {

if(document.getElementById('library2')){
// Create <thead> for DataTables to work
var header = document.getElementById('library2').createTHead().id = 'lib-thead';
jQuery('#lib-header').detach().appendTo('#lib-thead');
document.getElementById('tableHolder2').style.display='block';
// Activate DataTable
console.log('waiting');
var waitForDT = setInterval(function () {
console.log('in it');
if (typeof $('#library2').dataTable === 'function' && document.getElementById('tableHolder')) {
document.getElementById('ciw-loading').style.display='none';
$('#library').dataTable( {
scrollX: true,
dom: 'Plfrtip',
"order": [[ 0, 'desc' ]]

} );
clearInterval(waitForDT);
}
}, 100);
}
});

Revision as of 18:01, 7 February 2023

$(document).ready( function () {

	if(document.getElementById('library2')){
		// Create <thead> for DataTables to work
		var header = document.getElementById('library2').createTHead().id = 'lib-thead';
		jQuery('#lib-header').detach().appendTo('#lib-thead');
		document.getElementById('tableHolder2').style.display='block';
		
		// Activate DataTable
		console.log('waiting');
		var waitForDT = setInterval(function () {
			console.log('in it');
		    if (typeof $('#library2').dataTable === 'function' && document.getElementById('tableHolder')) {
				
				document.getElementById('ciw-loading').style.display='none';
		
		        $('#library').dataTable( {
		        	scrollX: true,
		        	dom: 'Plfrtip',
					"order": [[ 0, 'desc' ]]

		        } );
		
		
		        clearInterval(waitForDT);
		    }
		}, 100);
	}
});