fix object.keys call on non-object
This commit is contained in:
		
							
								
								
									
										18
									
								
								js/reveal.js
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								js/reveal.js
									
									
									
									
									
								
							@@ -3771,13 +3771,17 @@
 | 
			
		||||
		// keyboard modifier key is present
 | 
			
		||||
		if( activeElementIsCE || activeElementIsInput || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return;
 | 
			
		||||
 | 
			
		||||
		// While paused only allow resume keyboard events;
 | 
			
		||||
		// 'b', '.' or any key specifically mapped to togglePause
 | 
			
		||||
		var resumeKeyCodes = [66,190,191].concat( Object.keys( config.keyboard ).map( function( key ) {
 | 
			
		||||
			if( config.keyboard[key] === 'togglePause' ) {
 | 
			
		||||
				return parseInt( key, 10 );
 | 
			
		||||
			}
 | 
			
		||||
		}));
 | 
			
		||||
		// While paused only allow resume keyboard events; 'b', '.''
 | 
			
		||||
		var resumeKeyCodes = [66,190,191];
 | 
			
		||||
 | 
			
		||||
		// Custom key bindings for togglePause should be able to resume
 | 
			
		||||
		if( typeof config.keyboard === 'object' ) {
 | 
			
		||||
			resumeKeyCodes = resumeKeyCodes.concat( Object.keys( config.keyboard ).map( function( key ) {
 | 
			
		||||
				if( config.keyboard[key] === 'togglePause' ) {
 | 
			
		||||
					return parseInt( key, 10 );
 | 
			
		||||
				}
 | 
			
		||||
			}));
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if( isPaused() && resumeKeyCodes.indexOf( event.keyCode ) === -1 ) {
 | 
			
		||||
			return false;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user