var Unibase; (function (Unibase) { let Apps; (function (Apps) { let Collaboration; (function (Collaboration) { let Components; (function (Components) { class Fullscreen { constructor() { this.ssMenuBarFullScreen = false; this.isDocFullscreen = false; } refreshWordDocumentHeight(docObj) { this.docBase = Unibase.Apps.Collaboration.Components.DocEditor.Base.Instance(); let fullscreenElement = docObj.element; this.wordDocRibbon = document.getElementsByClassName('biz-doc-ribbon')[0]; this.wordDocToolbar = document.getElementsByClassName('biz-doc-bottomtoolbar')[0]; this.wordDocFooter = fullscreenElement.parentElement.nextElementSibling; this.wordDocFooter.style.display = "none"; this.wordDocRibbon.style.display = 'none'; this.wordDocToolbar.style.display = 'none'; docObj.height = window.innerHeight + 'px'; document.getElementsByClassName('e-de-text-target')[0].contentWindow.document.addEventListener("keyup", (e) => { this.refreshDocumentHeightProps(fullscreenElement); event.preventDefault(); this.exitFullscreenEsc(e, docObj); if (e.keyCode == 122) { if (!this.isDocFullscreen) { this.totalHeight = window.innerHeight - this.ribbonHeight - this.toolbarHeight - this.footerHeight; docObj.height = this.totalHeight + 'px'; this.isDocFullscreen = true; } else { this.totalHeight = window.innerHeight - this.ribbonHeight - this.toolbarHeight - this.footerHeight; docObj.height = this.totalHeight + 'px'; this.isDocFullscreen = false; } } }); document.body.addEventListener("keyup", (e) => { this.exitFullscreenEsc(e, this.docBase.wordDocumentObj); }); } refreshDocumentHeightProps(fullscreenElement) { this.ribbonHeight = document.getElementsByClassName("biz-doc-ribbon")[0].offsetHeight; this.toolbarHeight = document.getElementsByClassName("biz-doc-bottomtoolbar")[0].offsetHeight; this.footerHeight = fullscreenElement.parentElement.nextElementSibling.offsetHeight; } exitFullscreenEsc(e, docObj) { if (e.keyCode == 27) { this.refreshDocumentHeightProps(docObj.element); this.wordDocRibbon.style.display = ''; this.wordDocToolbar.style.display = ''; this.wordDocFooter.style.display = ""; this.totalHeight = window.innerHeight - this.ribbonHeight - this.toolbarHeight - this.footerHeight; docObj.height = this.totalHeight + 'px'; } } refreshSpreadsheetHeight(ssObj) { this.sheetBase = Unibase.Apps.Collaboration.Components.Sheets.Base.Instance(); this.dialog = Unibase.Apps.Collaboration.Components.Sheets.Dialogue.Instance(); this.ssMenuBarFullScreen = true; let fullscreenElement = ssObj.element; let sheetPannelElement = document.getElementById("DocumentViewer_sheet_panel"); fullscreenElement.parentElement.nextElementSibling.style.display = "none"; fullscreenElement.parentElement.previousElementSibling.style.display = "none"; document.getElementById('DocumentViewer_ribbon').style.display = 'none'; var footerHeight = sheetPannelElement.nextElementSibling.offsetHeight; var headerHeight = sheetPannelElement.previousElementSibling.offsetHeight; sheetPannelElement.style.height = window.innerHeight - footerHeight - headerHeight + "px"; this.dialog.renderMenubarFullscreenDialog(); } inintEvents() { } removeEvetns() { } static Instance() { if (this.instance === undefined) { this.instance = new Fullscreen(); } return this.instance; } } Components.Fullscreen = Fullscreen; })(Components = Collaboration.Components || (Collaboration.Components = {})); })(Collaboration = Apps.Collaboration || (Apps.Collaboration = {})); })(Apps = Unibase.Apps || (Unibase.Apps = {})); })(Unibase || (Unibase = {}));