Skip to content

Commit

Permalink
Fix panel restore size
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbj committed Mar 28, 2024
1 parent 8ff1b79 commit aeb2041
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion TracyDebugger.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
7 changes: 5 additions & 2 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit aeb2041

Please sign in to comment.