Sha256: da35630e8e28cb8bb8cee45feb78ce1bab25e0591b4618195e41e505e021f7a8

Contents?: true

Size: 1.72 KB

Versions: 28

Compression:

Stored size: 1.72 KB

Contents

// DATA_TEMPLATE: dom_data
oTest.fnStart( "sScrollX / Y" );


$(document).ready( function () {
	// Force some x scrolling
	$('body').css('white-space', 'nowrap');
	$('#container').css('width', '400px');

	var oTable = $('#example').dataTable( {
		"sScrollX": "100%",
		"sScrollY": "200px",
		"bPaginate": false
	} );
	
	oTest.fnWaitTest( 
		"Header follows x-scrolling",
		function () { $('div.dataTables_scrollBody').scrollLeft(20); },
		function () { return $('div.dataTables_scrollHead').scrollLeft() == 20; }
	);
	
	oTest.fnWaitTest( 
		"Footer follows x-scrolling",
		null,
		function () { return $('div.dataTables_scrollFoot').scrollLeft() == 20; }
	);
	
	oTest.fnWaitTest( 
		"y-scrolling has no effect on header",
		function () { $('div.dataTables_scrollBody').scrollTop(20); },
		function () { return $('div.dataTables_scrollHead').scrollLeft() == 20; }
	);
	
	oTest.fnWaitTest( 
		"Filtering results in sets y-scroll back to 0",
		function () { oTable.fnFilter('1') },
		function () { return $('div.dataTables_scrollBody').scrollTop() == 0; }
	);
	
	oTest.fnWaitTest( 
		"Filtering has no effect on x-scroll",
		null,
		function () { return $('div.dataTables_scrollBody').scrollLeft() == 20; }
	);
	
	oTest.fnWaitTest( 
		"Full x-scroll has header track all the way with it",
		function () {
			$('div.dataTables_scrollBody').scrollLeft(
				$('#example').width() - $('div.dataTables_scrollBody')[0].clientWidth
			);
		},
		function () { return $('div.dataTables_scrollBody').scrollLeft() == $('div.dataTables_scrollHead').scrollLeft(); }
	);
	
	oTest.fnTest( 
		"Footer also tracked all the way",
		null,
		function () { return $('div.dataTables_scrollBody').scrollLeft() == $('div.dataTables_scrollFoot').scrollLeft(); }
	);
	
	oTest.fnComplete();
} );

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
classiccms-0.7.5 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.7.4 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.7.3 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.7.2 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.7.1 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.7.0 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.6.9 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.6.8 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.6.7 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.6.6 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.6.5 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.6.4 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.6.3 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.6.2 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.6.1 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.6.0 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.5.17 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.5.16 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.5.15 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js
classiccms-0.5.14 lib/classiccms/public/admin/datatables/unit_testing/tests_onhold/1_dom/sScrollXY.js