presentations

Presentations
Log | Files | Refs

test-grid-navigation.html (1781B)


      1 <!doctype html>
      2 <html lang="en">
      3 
      4 	<head>
      5 		<meta charset="utf-8">
      6 
      7 		<title>reveal.js - Test Grid</title>
      8 
      9 		<link rel="stylesheet" href="../css/reveal.css">
     10 		<link rel="stylesheet" href="qunit-2.5.0.css">
     11 	</head>
     12 
     13 	<body style="overflow: auto;">
     14 
     15 		<div id="qunit"></div>
     16 		<div id="qunit-fixture"></div>
     17 
     18 		<div class="reveal" style="display: none;">
     19 
     20 			<div class="slides">
     21 
     22 				<section>0</section>
     23 				<section>
     24 					<section>1.1</section>
     25 					<section>1.2</section>
     26 					<section>1.3</section>
     27 					<section>1.4</section>
     28 				</section>
     29 				<section>
     30 					<section>2.1</section>
     31 					<section>2.2</section>
     32 					<section>2.3</section>
     33 					<section>2.4</section>
     34 				</section>
     35 
     36 			</div>
     37 
     38 		</div>
     39 
     40 		<script src="../js/reveal.js"></script>
     41 		<script src="qunit-2.5.0.js"></script>
     42 
     43 		<script>
     44 			Reveal.addEventListener( 'ready', function() {
     45 
     46 				QUnit.module( 'Grid Navigation' );
     47 
     48 				QUnit.test( 'Disabled', function( assert ) {
     49 					Reveal.right();
     50 					Reveal.down();
     51 					Reveal.down();
     52 					assert.deepEqual( Reveal.getIndices(), { h: 1, v: 2, f: undefined }, 'Correct starting point' );
     53 					Reveal.right();
     54 					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: undefined }, 'Moves to top when going to adjacent stack' );
     55 				});
     56 
     57 				QUnit.test( 'Enabled', function( assert ) {
     58 					Reveal.configure({ navigationMode: 'grid' });
     59 					Reveal.slide( 0, 0 );
     60 					Reveal.right();
     61 					Reveal.down();
     62 					Reveal.down();
     63 					assert.deepEqual( Reveal.getIndices(), { h: 1, v: 2, f: undefined }, 'Correct starting point' );
     64 					Reveal.right();
     65 					assert.deepEqual( Reveal.getIndices(), { h: 2, v: 2, f: undefined }, 'Remains at same vertical index when going to adjacent stack' );
     66 				});
     67 
     68 			} );
     69 
     70 			Reveal.initialize();
     71 		</script>
     72 
     73 	</body>
     74 </html>