Stop hard-coding the panel width in web/debugger.js

Thanks to CSS variables we can avoid hard-coding the panel width in the JavaScript code.
This commit is contained in:
Jonas Jenwald 2023-09-17 08:06:33 +02:00
parent 22cd0c6ff8
commit c9cd934f8a
2 changed files with 6 additions and 3 deletions

View file

@ -492,7 +492,6 @@ const Stats = (function Stats() {
// Manages all the debugging tools.
const PDFBug = (function PDFBugClosure() {
const panelWidth = 300;
const buttons = [];
let activePanel = null;
@ -541,7 +540,7 @@ const PDFBug = (function PDFBugClosure() {
ui.append(panels);
container.append(ui);
container.style.right = panelWidth + "px";
container.style.right = "var(--panel-width)";
// Initialize all the debugging tools.
for (const tool of this.tools) {