From 0d131f09578ef57571133413a53a18b8dc9707ea Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 2 Mar 2026 11:29:39 +0100 Subject: [PATCH] Use `L10n.prototype.getDirection` rather than querying the DOM, when initializing the `CommentManager` instance Hopefully I'm not misunderstanding why it was written like that, however using an existing method should be a tiny bit more efficient than querying the DOM. --- web/app.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/web/app.js b/web/app.js index 1a46dc590..ff3ec601b 100644 --- a/web/app.js +++ b/web/app.js @@ -500,9 +500,6 @@ const PDFViewerApplication = { ) : null; - const ltr = appConfig.viewerContainer - ? getComputedStyle(appConfig.viewerContainer).direction === "ltr" - : true; const commentManager = AppOptions.get("enableComment") && appConfig.editCommentDialog ? new CommentManager( @@ -532,7 +529,7 @@ const PDFViewerApplication = { eventBus, linkService, overlayManager, - ltr, + /* ltr = */ l10n.getDirection() === "ltr", hasForcedColors ) : null;