Check the relevant parameters inside of the mustBeViewedWhenEditing method
Similar to the `mustBeViewed` method, we can check the relevant parameters within the `mustBeViewedWhenEditing` method itself since that (in my opinion) slightly helps readability of the code in the `src/core/document.js` file.
This commit is contained in:
parent
9065ee465b
commit
5f744904ac
@ -777,8 +777,8 @@ class Annotation {
|
|||||||
return this.printable;
|
return this.printable;
|
||||||
}
|
}
|
||||||
|
|
||||||
mustBeViewedWhenEditing() {
|
mustBeViewedWhenEditing(isEditing, modifiedIds = null) {
|
||||||
return !this.data.isEditable;
|
return isEditing ? !this.data.isEditable : !modifiedIds?.has(this.data.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -582,8 +582,7 @@ class Page {
|
|||||||
intentAny ||
|
intentAny ||
|
||||||
(intentDisplay &&
|
(intentDisplay &&
|
||||||
annotation.mustBeViewed(annotationStorage, renderForms) &&
|
annotation.mustBeViewed(annotationStorage, renderForms) &&
|
||||||
((isEditing && annotation.mustBeViewedWhenEditing()) ||
|
annotation.mustBeViewedWhenEditing(isEditing, modifiedIds)) ||
|
||||||
(!isEditing && !modifiedIds?.has(annotation.data.id)))) ||
|
|
||||||
(intentPrint && annotation.mustBePrinted(annotationStorage))
|
(intentPrint && annotation.mustBePrinted(annotationStorage))
|
||||||
) {
|
) {
|
||||||
opListPromises.push(
|
opListPromises.push(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user