From 3339d03bf7e585645b452970de3858115c8f8d8c Mon Sep 17 00:00:00 2001 From: Daniel Poggenpohl Date: Mon, 8 Sep 2025 17:27:04 +0200 Subject: [PATCH] #157 - Fix for console errors + non-loaded comment editor using touchbased devices in rectangle mode --- shared/index.js | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/shared/index.js b/shared/index.js index 9a84f65..95c6586 100644 --- a/shared/index.js +++ b/shared/index.js @@ -8691,27 +8691,30 @@ function startIndex( return; } var _svg = overlay.parentNode.querySelector('svg.annotationLayer'); - renderRect( - _type, - [ - { - top: parseInt(overlay.style.top, 10) + rect.top, - left: parseInt(overlay.style.left, 10) + rect.left, - width: parseInt(overlay.style.width, 10), - height: parseInt(overlay.style.height, 10), - }, - ], - null - ); + var fn = () => { + [textarea, data] = (0, _commentWrapper.openCommentTouchscreen)( + e, + handleCancelTouch, + handleSubmitClick, + handleToolbarClick, + handleSubmitBlur, + _type + ); + renderRect( + _type, + [ + { + top: parseInt(overlay.style.top, 10) + rect.top, + left: parseInt(overlay.style.left, 10) + rect.left, + width: parseInt(overlay.style.width, 10), + height: parseInt(overlay.style.height, 10), + }, + ], + null + ); + } + _commentWrapper.loadEditor('add', 0, fn); - [textarea, data] = (0, _commentWrapper.openComment)( - e, - handleCancelTouch, - handleSubmitClick, - handleToolbarClick, - handleSubmitBlur, - _type - ); } else if ((rectsSelection = getSelectionRects()) && _type !== 'area') { renderRect( _type, @@ -10846,4 +10849,4 @@ function extract_text_from_html(html) { function get_post_content(commentList) { var commentInsidePtag = commentList.querySelectorAll(''); -} \ No newline at end of file +}