code format tweaks
This commit is contained in:
		
							
								
								
									
										29
									
								
								js/reveal.js
									
									
									
									
									
								
							
							
						
						
									
										29
									
								
								js/reveal.js
									
									
									
									
									
								
							| @@ -554,21 +554,36 @@ | |||||||
|  |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	/** | ||||||
|  | 	 * Converts the given HTML element into a string of text | ||||||
|  | 	 * that can be announced to a screen reader. Hidden | ||||||
|  | 	 * elements are excluded. | ||||||
|  | 	 */ | ||||||
| 	function getStatusText( node ) { | 	function getStatusText( node ) { | ||||||
| 		var text = ""; |  | ||||||
| 		if(node.nodeType === 3) { //text node | 		var text = ''; | ||||||
|  |  | ||||||
|  | 		// Text node | ||||||
|  | 		if( node.nodeType === 3 ) { | ||||||
| 			text += node.textContent; | 			text += node.textContent; | ||||||
| 		}else if (node.nodeType === 1) { //element node | 		} | ||||||
|  | 		// Element node | ||||||
|  | 		else if( node.nodeType === 1 ) { | ||||||
|  |  | ||||||
| 			var isAriaHidden = node.getAttribute( 'aria-hidden' ); | 			var isAriaHidden = node.getAttribute( 'aria-hidden' ); | ||||||
| 			var isDisplayHidden = window.getComputedStyle( node )['display'] === 'none'; | 			var isDisplayHidden = window.getComputedStyle( node )['display'] === 'none'; | ||||||
| 			if( isAriaHidden !== 'true' && !isDisplayHidden ) { | 			if( isAriaHidden !== 'true' && !isDisplayHidden ) { | ||||||
| 				var children = node.childNodes; |  | ||||||
| 				for (var i = 0;i < children.length; i++) { | 				toArray( node.childNodes ).forEach( function( child ) { | ||||||
| 					text += getStatusText(children[i]); | 					text += getStatusText( child ); | ||||||
| 				} | 				} ); | ||||||
|  |  | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		return text; | 		return text; | ||||||
|  |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	/** | 	/** | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user