@@ -46,7 +46,7 @@ class CommentManager {
4646 dateStyle : "long" ,
4747 } ) ;
4848 this . dialogElement = commentDialog . dialog ;
49- this . #dialog = new CommentDialog ( commentDialog , overlayManager , ltr ) ;
49+ this . #dialog = new CommentDialog ( commentDialog , overlayManager ) ;
5050 this . #popup = new CommentPopup ( dateFormat , ltr , this . dialogElement ) ;
5151 this . #sidebar = new CommentSidebar (
5252 sidebar ,
@@ -572,19 +572,15 @@ class CommentDialog {
572572
573573 #dialogY = 0 ;
574574
575- #isLTR;
576-
577575 constructor (
578576 { dialog, toolbar, title, textInput, cancelButton, saveButton } ,
579- overlayManager ,
580- ltr
577+ overlayManager
581578 ) {
582579 this . #dialog = dialog ;
583580 this . #textInput = textInput ;
584581 this . #overlayManager = overlayManager ;
585582 this . #saveButton = saveButton ;
586583 this . #title = title ;
587- this . #isLTR = ltr ;
588584
589585 const finishBound = this . #finish. bind ( this ) ;
590586 dialog . addEventListener ( "close" , finishBound ) ;
@@ -686,17 +682,6 @@ class CommentDialog {
686682 }
687683 this . #uiManager?. removeEditListeners ( ) ;
688684 this . #saveButton. disabled = true ;
689- const parentDimensions = options ?. parentDimensions ;
690- if (
691- parentDimensions &&
692- ( ( this . #isLTR &&
693- posX + this . _dialogWidth >
694- parentDimensions . x + parentDimensions . width ) ||
695- ( ! this . #isLTR && posX - this . _dialogWidth < parentDimensions . x ) )
696- ) {
697- const buttonWidth = this . #editor. commentButtonWidth ;
698- posX -= this . _dialogWidth - buttonWidth * parentDimensions . width ;
699- }
700685
701686 this . #setPosition( posX , posY ) ;
702687
@@ -903,7 +888,7 @@ class CommentPopup {
903888 this . #setPosition(
904889 this . #posX + ( x - this . #prevDragX) / parentWidth ,
905890 this . #posY + ( y - this . #prevDragY) / parentHeight ,
906- /* isDragging = */ true
891+ /* correctPosition = */ false
907892 ) ;
908893 this . #prevDragX = x ;
909894 this . #prevDragY = y ;
@@ -1019,7 +1004,10 @@ class CommentPopup {
10191004 this . #time. textContent = this . #dateFormat. format (
10201005 PDFDateString . toDateObject ( modificationDate || creationDate )
10211006 ) ;
1022- this . #setPosition( ...editor . commentPopupPosition ) ;
1007+ this . #setPosition(
1008+ ...editor . commentPopupPosition ,
1009+ /* correctPosition = */ editor . hasDefaultPopupPosition ( )
1010+ ) ;
10231011 editor . elementBeforePopup . after ( container ) ;
10241012 container . addEventListener (
10251013 "focus" ,
@@ -1033,8 +1021,8 @@ class CommentPopup {
10331021 }
10341022 }
10351023
1036- #setPosition( x , y , isDragging = false ) {
1037- if ( isDragging ) {
1024+ #setPosition( x , y , correctPosition = true ) {
1025+ if ( ! correctPosition ) {
10381026 this . #editor. commentPopupPosition = [ x , y ] ;
10391027 } else {
10401028 const widthRatio =
0 commit comments