Skip to content

Commit

Permalink
Merge pull request mozilla#18393 from Snuffleupagus/mustBeViewedWhenE…
Browse files Browse the repository at this point in the history
…diting-params

Check the relevant parameters inside of the `mustBeViewedWhenEditing` method
  • Loading branch information
timvandermeij authored Jul 5, 2024
2 parents cf9dfbc + 5f74490 commit ccb141e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,8 +777,8 @@ class Annotation {
return this.printable;
}

mustBeViewedWhenEditing() {
return !this.data.isEditable;
mustBeViewedWhenEditing(isEditing, modifiedIds = null) {
return isEditing ? !this.data.isEditable : !modifiedIds?.has(this.data.id);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/core/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,7 @@ class Page {
intentAny ||
(intentDisplay &&
annotation.mustBeViewed(annotationStorage, renderForms) &&
((isEditing && annotation.mustBeViewedWhenEditing()) ||
(!isEditing && !modifiedIds?.has(annotation.data.id)))) ||
annotation.mustBeViewedWhenEditing(isEditing, modifiedIds)) ||
(intentPrint && annotation.mustBePrinted(annotationStorage))
) {
opListPromises.push(
Expand Down

0 comments on commit ccb141e

Please sign in to comment.