Skip to content

[stable30] Fix disabled annotation edition in view only files#1123

Merged
danxuliu merged 2 commits intostable30from
backport/1108/stable30
Jan 30, 2025
Merged

[stable30] Fix disabled annotation edition in view only files#1123
danxuliu merged 2 commits intostable30from
backport/1108/stable30

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot bot commented Jan 30, 2025

Backport of #1108

@szaimen
Copy link
Copy Markdown
Collaborator

szaimen commented Jan 30, 2025

/compile

Copy link
Copy Markdown
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, let me amend the commit message 🙈

danxuliu and others added 2 commits January 30, 2025 12:25
When a PDF file was shared without edit permissions the annotation
editor buttons were hidden in the toolbar. Besides being a dirty trick,
it only prevented creating new annotations, but not editing existing
ones. Now the parameter "annotationEditorMode" of PDF.js set to
"AnnotationEditorType.DISABLE" is used instead, which properly disables
editing annotations and also takes care of removing the buttons from the
toolbar if needed.

Note that the editor mode separator is no longer hidden; it was hidden
back in the day when edition was not supported yet in the PDF viewer,
and once edition was added it should have been shown whenever the editor
buttons were shown, but it was not the case. Now it is shown by default
and hidden as needed by PDF.js itself when annotation edition is
disabled.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
@danxuliu danxuliu force-pushed the backport/1108/stable30 branch from 5d3e077 to dc34111 Compare January 30, 2025 11:33
Copy link
Copy Markdown
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍

@danxuliu danxuliu marked this pull request as ready for review January 30, 2025 11:36
@danxuliu danxuliu enabled auto-merge January 30, 2025 11:37
@danxuliu danxuliu merged commit 8199f26 into stable30 Jan 30, 2025
@Altahrim Altahrim mentioned this pull request Feb 5, 2025
15 tasks
@danxuliu danxuliu deleted the backport/1108/stable30 branch February 13, 2025 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants