Skip to content

Commit 0d131f0

Browse files
committed
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.
1 parent afa8a07 commit 0d131f0

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

web/app.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,6 @@ const PDFViewerApplication = {
500500
)
501501
: null;
502502

503-
const ltr = appConfig.viewerContainer
504-
? getComputedStyle(appConfig.viewerContainer).direction === "ltr"
505-
: true;
506503
const commentManager =
507504
AppOptions.get("enableComment") && appConfig.editCommentDialog
508505
? new CommentManager(
@@ -532,7 +529,7 @@ const PDFViewerApplication = {
532529
eventBus,
533530
linkService,
534531
overlayManager,
535-
ltr,
532+
/* ltr = */ l10n.getDirection() === "ltr",
536533
hasForcedColors
537534
)
538535
: null;

0 commit comments

Comments
 (0)