* @param {!Document} doc * @param {!LoadingViewConfig=} config
(doc, config = {})
| 10491 | * @param {!LoadingViewConfig=} config |
| 10492 | */ |
| 10493 | constructor(doc, config = {}) { |
| 10494 | /** @private @const {!Document} */ |
| 10495 | this.doc_ = doc; |
| 10496 | |
| 10497 | /** @private @const {!Element} */ |
| 10498 | this.loadingContainer_ = createElement( |
| 10499 | this.doc_, |
| 10500 | 'swg-loading-container', |
| 10501 | {} |
| 10502 | ); |
| 10503 | if (config.additionalClasses) { |
| 10504 | for (const additionalClass of config.additionalClasses) { |
| 10505 | this.loadingContainer_.classList.add(additionalClass); |
| 10506 | } |
| 10507 | } |
| 10508 | |
| 10509 | /** @private @const {!Element} */ |
| 10510 | this.loading_ = createElement(this.doc_, 'swg-loading', {}); |
| 10511 | this.loadingContainer_.appendChild(this.loading_); |
| 10512 | |
| 10513 | this.loadingContainer_.style.setProperty('display', 'none', 'important'); |
| 10514 | |
| 10515 | // Build the animated loading indicator. |
| 10516 | this.buildLoadingIndicator_(); |
| 10517 | } |
| 10518 | |
| 10519 | /** |
| 10520 | * Gets the populated loading container. |
nothing calls this directly
no test coverage detected