statusDiv -> statusElement

This commit is contained in:
Hakim El Hattab 2020-03-09 18:57:49 +01:00
parent 8a43753000
commit 75ef44ca69

View File

@ -280,7 +280,7 @@ export default function( revealElement, options ) {
dom.controlsLeftArrow = dom.controls.querySelector( '.navigate-left' ); dom.controlsLeftArrow = dom.controls.querySelector( '.navigate-left' );
dom.controlsDownArrow = dom.controls.querySelector( '.navigate-down' ); dom.controlsDownArrow = dom.controls.querySelector( '.navigate-down' );
dom.statusDiv = createStatusDiv(); dom.statusElement = createStatusElement();
} }
/** /**
@ -290,22 +290,22 @@ export default function( revealElement, options ) {
* *
* @return {HTMLElement} * @return {HTMLElement}
*/ */
function createStatusDiv() { function createStatusElement() {
let statusDiv = dom.wrapper.querySelector( '.aria-status' ); let statusElement = dom.wrapper.querySelector( '.aria-status' );
if( !statusDiv ) { if( !statusElement ) {
statusDiv = document.createElement( 'div' ); statusElement = document.createElement( 'div' );
statusDiv.style.position = 'absolute'; statusElement.style.position = 'absolute';
statusDiv.style.height = '1px'; statusElement.style.height = '1px';
statusDiv.style.width = '1px'; statusElement.style.width = '1px';
statusDiv.style.overflow = 'hidden'; statusElement.style.overflow = 'hidden';
statusDiv.style.clip = 'rect( 1px, 1px, 1px, 1px )'; statusElement.style.clip = 'rect( 1px, 1px, 1px, 1px )';
statusDiv.classList.add( 'aria-status' ); statusElement.classList.add( 'aria-status' );
statusDiv.setAttribute( 'aria-live', 'polite' ); statusElement.setAttribute( 'aria-live', 'polite' );
statusDiv.setAttribute( 'aria-atomic','true' ); statusElement.setAttribute( 'aria-atomic','true' );
dom.wrapper.appendChild( statusDiv ); dom.wrapper.appendChild( statusElement );
} }
return statusDiv; return statusElement;
} }
@ -314,7 +314,7 @@ export default function( revealElement, options ) {
*/ */
function announceStatus( value ) { function announceStatus( value ) {
dom.statusDiv.textContent = value; dom.statusElement.textContent = value;
} }