From 4547ea668a0d9d5e25b797a5781c59bc33c37d0a Mon Sep 17 00:00:00 2001 From: cpsdqs Date: Sun, 8 Oct 2017 23:31:55 +0200 Subject: [PATCH] Make fullscreen mode work again --- js/term/index.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/js/term/index.js b/js/term/index.js index 5f40d0e..f8155a9 100644 --- a/js/term/index.js +++ b/js/term/index.js @@ -138,28 +138,28 @@ module.exports = function (opts) { let isFullscreen = false let properFullscreen = false let fitScreen = false - let screenPadding = screen.window.padding + let screenPadding = screen.layout.window.padding let fitScreenIfNeeded = function fitScreenIfNeeded () { if (isFullscreen) { fullscreenIcon.className = 'icn-resize-small' if (properFullscreen) { - screen.window.fitIntoWidth = window.screen.width - screen.window.fitIntoHeight = window.screen.height - screen.window.padding = 0 + screen.layout.window.fitIntoWidth = window.screen.width + screen.layout.window.fitIntoHeight = window.screen.height + screen.layout.window.padding = 0 } else { - screen.window.fitIntoWidth = window.innerWidth + screen.layout.window.fitIntoWidth = window.innerWidth if (qs('#term-nav').classList.contains('hidden')) { - screen.window.fitIntoHeight = window.innerHeight + screen.layout.window.fitIntoHeight = window.innerHeight } else { - screen.window.fitIntoHeight = window.innerHeight - 24 + screen.layout.window.fitIntoHeight = window.innerHeight - 24 } - screen.window.padding = 0 + screen.layout.window.padding = 0 } } else { fullscreenIcon.className = 'icn-resize-full' - screen.window.fitIntoWidth = fitScreen ? window.innerWidth - 4 : 0 - screen.window.fitIntoHeight = fitScreen ? window.innerHeight : 0 - screen.window.padding = screenPadding + screen.layout.window.fitIntoWidth = fitScreen ? window.innerWidth - 4 : 0 + screen.layout.window.fitIntoHeight = fitScreen ? window.innerHeight : 0 + screen.layout.window.padding = screenPadding } } fitScreenIfNeeded() @@ -213,11 +213,11 @@ module.exports = function (opts) { isFullscreen = true fitScreenIfNeeded() - screen.updateSize() + screen.layout.updateSize() if (properFullscreen) { - if (screen.canvas.requestFullscreen) screen.canvas.requestFullscreen() - else screen.canvas.webkitRequestFullscreen() + if (screen.layout.canvas.requestFullscreen) screen.layout.canvas.requestFullscreen() + else screen.layout.canvas.webkitRequestFullscreen() } else { document.body.classList.add('pseudo-fullscreen') }