UNPKG

1.22 kBJavaScriptView Raw
1/**
2 * The OverlayContainer is the container in which all overlays will load.
3 * It should be provided in the root component to ensure it is properly shared.
4 */
5export var OverlayContainer = (function () {
6 function OverlayContainer() {
7 }
8 /**
9 * This method returns the overlay container element. It will lazily
10 * create the element the first time it is called to facilitate using
11 * the container in non-browser environments.
12 * @returns {HTMLElement} the container element
13 */
14 OverlayContainer.prototype.getContainerElement = function () {
15 if (!this._containerElement) {
16 this._createContainer();
17 }
18 return this._containerElement;
19 };
20 /**
21 * Create the overlay container element, which is simply a div
22 * with the 'md-overlay-container' class on the document body.
23 */
24 OverlayContainer.prototype._createContainer = function () {
25 var container = document.createElement('div');
26 container.classList.add('md-overlay-container');
27 document.body.appendChild(container);
28 this._containerElement = container;
29 };
30 return OverlayContainer;
31}());
32
33//# sourceMappingURL=overlay-container.js.map