/*!
 *
 * carbon-angular v0.0.7 | documentation.component.js
 *
 * Copyright 2014, 2019 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


import { Component, Input, ElementRef } from "@angular/core";
import { DomSanitizer } from "@angular/platform-browser";
var Documentation = /** @class */ (function () {
    function Documentation(elementRef, sanitizer) {
        this.elementRef = elementRef;
        this.sanitizer = sanitizer;
    }
    Object.defineProperty(Documentation.prototype, "src", {
        get: function () {
            return this._src;
        },
        set: function (src) {
            this._src = this.sanitizer.bypassSecurityTrustResourceUrl(src);
        },
        enumerable: true,
        configurable: true
    });
    Documentation.prototype.ngOnInit = function () {
        document.querySelector("html").style.overflow = "hidden";
        document.querySelector(".sb-show-main").classList.add("full-page");
    };
    Documentation.prototype.ngOnDestroy = function () {
        document.querySelector("html").style.overflow = "auto";
        document.querySelector(".sb-show-main").classList.remove("full-page");
    };
    Documentation.prototype.onLoad = function () {
        var docsIframe = this.elementRef.nativeElement.querySelector("#docsIframe");
        var docsDocument = docsIframe.contentDocument || docsIframe.contentWindow.document;
        var docsBody = docsDocument.querySelector("body");
        var mainContent = docsBody.querySelector(".content");
        mainContent.style.width = "100%";
        mainContent.style.left = 0;
        var menuContent = docsBody.querySelector(".hidden-xs.menu");
        menuContent.style.display = "none";
    };
    Documentation.decorators = [
        { type: Component, args: [{
                    selector: "ibm-documentation",
                    template: "\n\t\t<iframe\n\t\t\tid=\"docsIframe\"\n\t\t\tstyle=\"width: 100vw; height: 100vh;\"\n\t\t\t(load)=\"onLoad()\"\n\t\t\t[src]=\"src\">\n\t\t</iframe>\n\t"
                },] },
    ];
    /** @nocollapse */
    Documentation.ctorParameters = function () { return [
        { type: ElementRef },
        { type: DomSanitizer }
    ]; };
    Documentation.propDecorators = {
        src: [{ type: Input }]
    };
    return Documentation;
}());
export { Documentation };
//# sourceMappingURL=documentation.component.js.map