|
@@ -457,11 +457,16 @@ class PDFPageView {
|
|
|
|
|
|
selectAnnotation(annotation) {
|
|
|
annotation.name && (this.annotationStore.toSelectAnnotationName = annotation.name)
|
|
|
- if (!this.compdfAnnotationLayer) return
|
|
|
- const annotationsArray = this.compdfAnnotationLayer.annotationsArray
|
|
|
+ const compdfAnnotationLayer = this.compdfAnnotationLayer
|
|
|
+ if (!compdfAnnotationLayer) return
|
|
|
+ const annotationsArray = compdfAnnotationLayer.annotationsArray
|
|
|
const annotationIndex = annotationsArray.findIndex(item => item.annotation.name === this.annotationStore.toSelectAnnotationName)
|
|
|
+ if (compdfAnnotationLayer.selectedElementName) {
|
|
|
+ const selectedAnnotationIndex = annotationsArray.findIndex(item => item.annotation.name === compdfAnnotationLayer.selectedElementName)
|
|
|
+ selectedAnnotationIndex > -1 && compdfAnnotationLayer.annotationsArray[selectedAnnotationIndex].handleOutside()
|
|
|
+ }
|
|
|
if (annotationIndex > -1) {
|
|
|
- this.compdfAnnotationLayer.annotationsArray[annotationIndex].selectAnnotation()
|
|
|
+ compdfAnnotationLayer.annotationsArray[annotationIndex].selectAnnotation()
|
|
|
this.annotationStore.toSelectAnnotationName = null
|
|
|
}
|
|
|
}
|