@angular2-material/core
Version:
Angular 2 Material core
34 lines (32 loc) • 1.22 kB
JavaScript
/**
* The OverlayContainer is the container in which all overlays will load.
* It should be provided in the root component to ensure it is properly shared.
*/
export var OverlayContainer = (function () {
function OverlayContainer() {
}
/**
* This method returns the overlay container element. It will lazily
* create the element the first time it is called to facilitate using
* the container in non-browser environments.
* @returns {HTMLElement} the container element
*/
OverlayContainer.prototype.getContainerElement = function () {
if (!this._containerElement) {
this._createContainer();
}
return this._containerElement;
};
/**
* Create the overlay container element, which is simply a div
* with the 'md-overlay-container' class on the document body.
*/
OverlayContainer.prototype._createContainer = function () {
var container = document.createElement('div');
container.classList.add('md-overlay-container');
document.body.appendChild(container);
this._containerElement = container;
};
return OverlayContainer;
}());
//# sourceMappingURL=overlay-container.js.map