From 9edb55d9af4540c693a90d850427ffbc4075811d Mon Sep 17 00:00:00 2001 From: m-bene Date: Mon, 7 Apr 2014 12:07:29 +0200 Subject: [PATCH] Modify window size to exclude task bar area --- web/skins/classic/js/skin.js | 17 +++++++++++++++++ web/skins/flat/js/skin.js | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/web/skins/classic/js/skin.js b/web/skins/classic/js/skin.js index 9c79e301b..7aa4907d3 100644 --- a/web/skins/classic/js/skin.js +++ b/web/skins/classic/js/skin.js @@ -71,6 +71,23 @@ var popupSizes = { var popupOptions = "resizable,scrollbars,status=no"; +function checkSize() { + if (window.outerHeight) { + var w = window.outerWidth; + var prevW = w; + var h = window.outerHeight; + var prevH = h; + if (h > screen.availHeight) + h = screen.availHeight; + if (w > screen.availWidth) + w = screen.availWidth; + if (w != prevW || h != prevH) + window.resizeTo(w,h); + } +} + +window.addEvent( 'domready', checkSize); + // Deprecated function newWindow( url, name, width, height ) { diff --git a/web/skins/flat/js/skin.js b/web/skins/flat/js/skin.js index a1f89bc06..a8439db64 100644 --- a/web/skins/flat/js/skin.js +++ b/web/skins/flat/js/skin.js @@ -71,6 +71,23 @@ var popupSizes = { var popupOptions = "resizable,scrollbars,status=no"; +function checkSize() { + if (window.outerHeight) { + var w = window.outerWidth; + var prevW = w; + var h = window.outerHeight; + var prevH = h; + if (h > screen.availHeight) + h = screen.availHeight; + if (w > screen.availWidth) + w = screen.availWidth; + if (w != prevW || h != prevH) + window.resizeTo(w,h); + } +} + +window.addEvent( 'domready', checkSize); + // Deprecated function newWindow( url, name, width, height ) {