UNPKG

md2

Version:

Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Chips(Tags), Collapse, Colorpicker, Data Table, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.

78 lines 3.73 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; import { Injectable } from '@angular/core'; import { OverlayContainer } from './overlay-container'; /** * The FullscreenOverlayContainer is the alternative to OverlayContainer * that supports correct displaying of overlay elements in Fullscreen mode * https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen * It should be provided in the root component that way: * providers: [ * {provide: OverlayContainer, useClass: FullscreenOverlayContainer} * ], */ var FullscreenOverlayContainer = (function (_super) { __extends(FullscreenOverlayContainer, _super); function FullscreenOverlayContainer() { return _super !== null && _super.apply(this, arguments) || this; } FullscreenOverlayContainer.prototype._createContainer = function () { var _this = this; _super.prototype._createContainer.call(this); this._adjustParentForFullscreenChange(); this._addFullscreenChangeListener(function () { return _this._adjustParentForFullscreenChange(); }); }; FullscreenOverlayContainer.prototype._adjustParentForFullscreenChange = function () { if (!this._containerElement) { return; } var fullscreenElement = this.getFullscreenElement(); var parent = fullscreenElement || document.body; parent.appendChild(this._containerElement); }; FullscreenOverlayContainer.prototype._addFullscreenChangeListener = function (fn) { if (document.fullscreenEnabled) { document.addEventListener('fullscreenchange', fn); } else if (document.webkitFullscreenEnabled) { document.addEventListener('webkitfullscreenchange', fn); } else if (document.mozFullScreenEnabled) { document.addEventListener('mozfullscreenchange', fn); } else if (document.msFullscreenEnabled) { document.addEventListener('MSFullscreenChange', fn); } }; /** * When the page is put into fullscreen mode, a specific element is specified. * Only that element and its children are visible when in fullscreen mode. */ FullscreenOverlayContainer.prototype.getFullscreenElement = function () { return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement || null; }; return FullscreenOverlayContainer; }(OverlayContainer)); FullscreenOverlayContainer = __decorate([ Injectable() ], FullscreenOverlayContainer); export { FullscreenOverlayContainer }; //# sourceMappingURL=fullscreen-overlay-container.js.map