From aeb20413dd8d4c490dba6a7d5248bfad1d79066e Mon Sep 17 00:00:00 2001 From: Adrian Jones Date: Wed, 27 Mar 2024 20:57:57 -0700 Subject: [PATCH] Fix panel restore size --- TracyDebugger.module.php | 2 +- scripts/main.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/TracyDebugger.module.php b/TracyDebugger.module.php index 1da4926..e7a5e08 100644 --- a/TracyDebugger.module.php +++ b/TracyDebugger.module.php @@ -27,7 +27,7 @@ public static function getModuleInfo() { 'summary' => __('Tracy debugger from Nette with many PW specific custom tools.', __FILE__), 'author' => 'Adrian Jones', 'href' => 'https://processwire.com/talk/forum/58-tracy-debugger/', - 'version' => '4.26.6', + 'version' => '4.26.7', 'autoload' => 100000, // in PW 3.0.114+ higher numbers are loaded first - we want Tracy first 'singular' => true, 'requires' => 'ProcessWire>=2.7.2, PHP>=5.4.4', diff --git a/scripts/main.js b/scripts/main.js index f9bd12c..1177690 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -4,8 +4,11 @@ function tracyResizePanel(panel) { tracyPanel.elem.classList.add('tracy-panel-resized'); tracyPanel.elem.dataset.tracyContent = true; // hack to satisy condition in Tracy's restorePosition() method - var maxPanelWidth = window.clientHeight < window.scrollHeight ? 'calc(100vw - 15px)' : '100vw'; - var maxPanelHeight = 'calc(100vh - 44px)'; + let vw = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0) + let vh = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0) + + var maxPanelWidth = (window.clientHeight < window.scrollHeight ? (vw - 15) : vw) + 'px'; + var maxPanelHeight = (vh - 44) + 'px'; if(panel.style.width == maxPanelWidth && panel.style.height == maxPanelHeight) { tracyPanel.restorePosition();