Merge pull request #322 from commadelimited/deactivate-nav-during-pause
Only allow 'unpause' keyboard events while paused
This commit is contained in:
		| @@ -632,7 +632,7 @@ var Reveal = (function(){ | |||||||
| 					continue; | 					continue; | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
| 				// Vertical stacks are not centered since their section  | 				// Vertical stacks are not centered since their section | ||||||
| 				// children will be | 				// children will be | ||||||
| 				if( slide.classList.contains( 'stack' ) ) { | 				if( slide.classList.contains( 'stack' ) ) { | ||||||
| 					slide.style.top = 0; | 					slide.style.top = 0; | ||||||
| @@ -663,7 +663,7 @@ var Reveal = (function(){ | |||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	/** | 	/** | ||||||
| 	 * Retrieves the vertical index which was stored using  | 	 * Retrieves the vertical index which was stored using | ||||||
| 	 * #setPreviousVerticalIndex() or 0 if no previous index | 	 * #setPreviousVerticalIndex() or 0 if no previous index | ||||||
| 	 * exists. | 	 * exists. | ||||||
| 	 * | 	 * | ||||||
| @@ -1549,6 +1549,11 @@ var Reveal = (function(){ | |||||||
|  |  | ||||||
| 		var triggered = true; | 		var triggered = true; | ||||||
|  |  | ||||||
|  | 		// while paused only allow "unpausing" keyboard events (b and .) | ||||||
|  | 		if (isPaused() && [66,190,191].indexOf(event.keyCode) === -1 ) { | ||||||
|  | 			return false; | ||||||
|  | 		} | ||||||
|  |  | ||||||
| 		switch( event.keyCode ) { | 		switch( event.keyCode ) { | ||||||
| 			// p, page up | 			// p, page up | ||||||
| 			case 80: case 33: navigatePrev(); break; | 			case 80: case 33: navigatePrev(); break; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user